Remove admin role from the “Author” user listing on individual post screen

This is the answer for my above Question add_action(‘pre_user_query’,’ap_pre_user_query’); function ap_pre_user_query($user_search) { $user = wp_get_current_user(); if ($user->ID!=1) { // Is not administrator, remove administrator (you can add any user-ID) global $wpdb; global $user_ID; //Fetch the custom field value added in user section $meta = get_user_meta( $user_ID ); $selected_author_id = unserialize($meta[‘select_md’][0]); $count = count($selected_author_id); //to the … Read more

Add /category/ to an author archive page

You can achieve this by adding a new rewrite rule using ‘add_rewrite_rule`. If the category is the default WordPress category, you won’t have to register a query_var but if your category is a custom category, then you would have to register a query_var using the query_vars filter. If category is the default WordPress category: function … Read more

slow WP_Query for non-admin user

ok,so I digged into wp-includes/query.php,and found this on line 3180: if ( is_user_logged_in() ) { // Add private states that are limited to viewing by the author of a post or someone who has caps to read private states. $private_states = get_post_stati( array(‘private’ => true) ); foreach ( (array) $private_states as $state ) $where .= … Read more

Custom Query by Author field and meta

By adding another array $args = array( ‘post_type’ => ‘custom_post_type’, ‘meta_query’ => array( array( ‘key’ => ‘size’, ‘value’ => ‘big’, ‘compare’ => ‘LIKE’, ), array( ‘key’ => ‘gender’, ‘value’ => ‘male’, ), ) ); $query = new WP_Query( $args );

How to set add question capability for author role in wp pro quiz plugin

A much more efficient way that doesn’t require editing the source code: install and activate wpfront User role editor, go to all roles, edit the author role, scroll down to the ‘other capabilities’ section, check the following capabilities: wpProQuiz_show, wpProQuiz_add_quiz, wpProQuiz_edit_quiz Save. The authors on your site should now be able to add and edit … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)