WordPress.org

Making WordPress.org


Ignore:
Timestamp:
09/22/2017 09:49:13 PM (8 months ago)
Author:
ocean90
Message:

Handbook plugin: For widget, include private pages if current user can read them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/inc/widgets.php

    r3485 r5959  
    4646        if ( in_array( $post->post_type, $this->post_types ) ) {
    4747            $args['post_type'] = $post->post_type;
     48        }
     49
     50        $post_type_obj = get_post_type_object( $post->post_type );
     51
     52        if ( current_user_can( $post_type_obj->cap->read_private_posts ) ) {
     53            $args['post_status'] = array( 'publish', 'private' );
    4854        }
    4955
Note: See TracChangeset for help on using the changeset viewer.