Search
 
SCRIPT & CODE EXAMPLE
 

PHP

buddypress groups dropdown

<div>
    <?php global $bp,$wpdb;
        $group_id = get_post_meta( $post->ID, 'campaign_group_id', true );
            $group_results = $wpdb->get_results("SELECT id,name FROM {$wpdb->prefix}bp_groups ORDER BY ID ASC");
            ?>
                <label for="meta-box-dropdown">ADD/EDIT</label>
                    <select name="meta-box-dropdown">
                    <?php foreach($group_results as $group_result): ?>
                <option <?php echo  ($group_id==$group_result->id)?"selected=selected":"" ?> value="<?php echo $group_result->id ?>"><?php echo $group_result->name ?></option>
        <?php   endforeach; ?>  
    </select>
    <br>
</div>
Comment

PREVIOUS NEXT
Code Example
Php :: fuelphp authentication 
Php :: php execute powershell script with parameters 
Php :: textarea autocomplete phpmyadmin style 
Php :: laravel chain query builder 
Php :: many to many relationship in laravel example stackoverflow 
Php :: Yii2 Dynamic Relational, Lazy loading 
Php :: Writing into the database with one click laravel 
Php :: index.php when deploying 
Php :: wp plugin handles 
Php :: laravel telescope redirect to localhost 
Php :: register column types octobercms 
Php :: livewire layout error 
Php :: date selct option php 
Php :: Définir un nombre maximum de mots sur les titres des publications WordPress 
Php :: $usr= $_POST["user"]; $pswd= $_POST["pass"]; 
Php :: download yii 1.1 
Php :: php update json file 
Php :: Program to Multiply Two Numbers in php 
Php :: laravel Why using additive paramerer in Resource collection raised error 
Php :: Add a watermark to an existing PDF document 
Php :: voirs les cles etrangeres phpmyadmin 
Php :: base64 encode php check 
Php :: selecting a time zone from a drop-down list 
Php :: how to make login and logout to blog with php without database or MySQL 
Php :: how to include pdf in php page 
Php :: how to use “find_in_set” in cakephp 3 find method 
Php :: failed to delete data in mysqli using php 
Php :: solaris 11 php mysql 
Php :: php hook function 
Php :: image downlord 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =