Making WordPress.org


Ignore:
Timestamp:
08/18/2017 07:21:31 PM (9 years ago)
Author:
danielbachhuber
Message:

phpunit-test-reporter: Use more precise filtering

Props SergeyBiryukov
Fixes #3051

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/phpunit-test-reporter/src/class-display.php

    r5807 r5823  
    1818         */
    1919        public static function filter_post_class( $classes ) {
    20                 if ( is_singular( 'result' ) && get_the_ID() === get_queried_object_id() ) {
     20                if ( is_singular( 'result' )
     21                        && get_the_ID() === get_queried_object_id()
     22                        && 'result' === get_post_type( get_the_ID() ) ) {
    2123                        $classes[] = 'page';
    2224                }
     
    2830         */
    2931        public static function filter_the_content( $content ) {
    30                 if ( ! is_singular( 'result' ) || get_the_ID() !== get_queried_object_id() ) {
     32                if ( ! is_singular( 'result' )
     33                        || get_the_ID() !== get_queried_object_id()
     34                        || 'result' !== get_post_type( get_the_ID() ) ) {
     35                        return $content;
     36                }
     37
     38                if ( ! did_action( 'loop_start' ) ) {
    3139                        return $content;
    3240                }
Note: See TracChangeset for help on using the changeset viewer.