WordPress.org

Make WordPress Core

Ticket #11695: 11695.diff

File 11695.diff, 590 bytes (added by blepoxp, 4 years ago)

Intercepts inside do_feed() function

  • wp-includes/functions.php

     
    17171717                wp_die( $message, '', array( 'response' => 404 ) ); 
    17181718        } 
    17191719 
    1720         do_action( $hook, $wp_query->is_comment_feed ); 
     1720        if ( $wp_query->is_comment_feed && $wp_query->is_singular && ( !current_user_can( 'read_private_posts' ) && 'private' == $wp_query->post->post_status ) ) 
     1721                include_once( get_404_template() ); 
     1722        else 
     1723                do_action( $hook, $wp_query->is_comment_feed ); 
    17211724} 
    17221725 
    17231726/**