Making WordPress.org

Changeset 4581


Ignore:
Timestamp:
12/23/2016 07:05:14 PM (8 years ago)
Author:
coffee2code
Message:

developer.wordpress.org: Also check access modifier to determine if function or class method is private.

Fixes #2344.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/inc/template-tags.php

    r4580 r4581  
    13971397        }
    13981398
    1399         $tags        = get_post_meta( $post->ID, '_wp-parser_tags', true );
     1399        $tags = get_post_meta( $post->ID, '_wp-parser_tags', true );
     1400
    14001401        $access_tags = wp_filter_object_list( $tags, array(
    14011402            'name'    => 'access',
    14021403            'content' => 'private'
    14031404        ) );
     1405        $is_private = ! empty( $access_tags );
     1406
     1407        if ( ! $is_private ) {
     1408            if ( 'private' === get_post_meta( $post->ID, '_wp-parser_visibility', true ) ) {
     1409                $is_private = true;
     1410            }
     1411        }
    14041412
    14051413        // Bail if it isn't private.
    1406         if ( empty( $access_tags ) ) {
     1414        if ( ! $is_private ) {
    14071415            return '';
    14081416        }
Note: See TracChangeset for help on using the changeset viewer.