Display only author posts in dashboard all posts panel

The following worked for me to show only the current user’s posts in the admin add_action( ‘load-edit.php’, ‘posts_for_current_author’ ); function posts_for_current_author() { global $user_ID; /*if current user is an ‘administrator’ do nothing*/ //if ( current_user_can( ‘add_users’ ) ) return; /*if current user is an ‘administrator’ or ‘editor’ do nothing*/ if ( current_user_can( ‘edit_others_pages’ ) ) … Read more

Display emails of users who already posted at least once

You can place following code in your functions.php file & use the shortcode [myblogwriters min_posts=”1″] anywhere in the page/post content and can also change the min_posts value 🙂 function show_min_one_post_writers($atts){ global $wpdb; $attrs = shortcode_atts( array( ‘min_posts’ => ” ), $atts ); $min_posts = $attrs[‘min_posts’]; $authors = $wpdb->get_col(“SELECT `post_author` FROM (SELECT `post_author`, COUNT(*) AS `count` … Read more

Post list based on the page author

As mentioned by @mridul-aggarwal WordPress supports author pages with the author.php template (Author_Template). If you are setting up a custom template you will need some method of letting the template discover which user is supposed to be displayed, this is usually done via a POST/GET request or in the URI http://example.com/path/to/user/username which you can then … Read more

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

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