All Users > User List > Update User Meta Field Inline

Yes, we need jQuery for that. The first thing is to give proper classes and ID’s to the elements. In manage_users_custom_column, add a class and a data selector to the checkbox: “<input type=”checkbox” data-approval=”#approval-$user_id” class=”my-class” value=”{$column_value}” />” And in user_row_actions, an ID to the <a> tag: id=’approval-$user_id’. Now, we have all the elements properties and … Read more

how to give a user a role?

or / NOTE: Of course change 3 to the appropriate user ID $u = new WP_User( 3 ); // Remove role $u->remove_role( ‘subscriber’ ); // Add role $u->add_role( ‘editor’ ); Super Admin – somebody with access to the site network administration features and all other features. See the Create a Network article. Administrator – somebody … Read more

Inserting above the comment template

It mainly depends on a theme, whether there is a hook, in which you can call an action. Simple ways, how to do that: You insert your code directly into single.php, right above the code calling comments_template(), You create a hook (e.g. above comments_template()) as do_action(‘my_hook’) and then you hook into it your function add_action(‘my_hook’, … Read more

Cannot install plugins on Centos VPS

Okay, I figured this out based upon suggestions from StackOverflow. This is how I resolved this issue: I created a group called ftpusers. groupadd ftpusers I added my wordpress user to this group. usermod -a -G ftpusers wordpressuser I changed ownership of the wordpress folder recursively to my wordpress user:group. chown -R wordpressuser:ftpusers wordpress Voila … Read more

Want wp_get_post_terms return in arbitrarily order, how to do?

add_filter(‘the_content’,’my_function’); function my_function($content){ the_post_thumbnail(‘thumbnail’, array(‘class’ => ‘top-post-img’ )); if (is_single() && in_category(‘5′)){ global $post; $term_list = wp_get_post_terms ($post->ID,’school’,array(‘fields’=>’names’)); ?> <div id=”some_class”> <span>School:<strong><?php print_r($term_list[0]); ?></strong></span> <?php if (is_single() && in_category(‘5′)){ $term_list = wp_get_post_terms ($post->ID,’article’,array(‘fields’ =>’names’)); ?> <span>Article:<strong><?php print_r($term_list[0]); ?></strong></span> <?php if (is_single() && in_category(‘5′)){ $term_list = wp_get_post_terms ($post->ID,’teacher’,array(‘fields’=>’names’)); ?> <span>Teacher:<strong><?php print_r($term_list[0]); ?></strong></span> </div> <?php return $content; … Read more