Make WordPress Core

Opened 8 years ago

Closed 2 months ago

#41355 closed defect (bug) (invalid)

get_post_status filter is ignored in some cases

Reported by: zaycakitayca's profile zaycakitayca Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.8
Component: Posts, Post Types Keywords:
Focuses: Cc:

Description

Code:

<?php
add_filter( 'get_post_status', function( $post_status, $post ) {
        return 'private';
}, 10, 2 );

What does not work:
For unauthourized user posts still displayed in categories, "Recent posts", "Recent comments" and maybe somewhere else.

Change History (1)

#1 @SirLouen
2 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

You have to edit the theme you are using or create your own theme to avoid this. By default not all themes check for this in certain templates.

Note: See TracTickets for help on using tickets.