0

In wp-admin/includes/class-wp-posts-list-table.php lines 59-69:

if ( !current_user_can( $post_type_object->cap->edit_others_posts ) ) {
            $exclude_states = get_post_stati( array( 'show_in_admin_all_list' => false ) );
            $this->user_posts_count = $wpdb->get_var( $wpdb->prepare( "
                SELECT COUNT( 1 ) FROM $wpdb->posts
                WHERE post_type = %s AND post_status NOT IN ( '" . implode( "','", $exclude_states ) . "' )
                AND post_author = %d
            ", $post_type, get_current_user_id() ) );

            if ( $this->user_posts_count && empty( $_REQUEST['post_status'] ) && empty( $_REQUEST['all_posts'] ) && empty( $_REQUEST['author'] ) && empty( $_REQUEST['show_sticky'] ) )
                $_GET['author'] = get_current_user_id();
        }

The code above controls the display of 'Mine' tab in the post edit screen (which appears beside: All, Published, Drafts, Pending.. etc):

Apparently, this only show up to users who can't edit_others_posts (Authors and Contributors for example).

Can I change this condition so that 'Mine' tab would show up for all users? Without hacking this code file.

4
  • Please edit your question to include your current, relevant code. This question is impossible to answer in a vacuum. Commented Nov 14, 2013 at 14:49
  • I don't see that you can "dismiss" that line without hack Core files. Please explain your project and there may be some other solution.
    – s_ha_dum
    Commented Nov 14, 2013 at 15:00
  • Just edited the question.
    – Ahmed Saad
    Commented Nov 14, 2013 at 18:02
  • Any one can help?
    – Ahmed Saad
    Commented Nov 15, 2013 at 13:26

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.