[wp-trac] [WordPress Trac] #54375: Add is_post_status_viewable filter

WordPress Trac noreply at wordpress.org
Mon Nov 8 15:21:06 UTC 2021


#54375: Add is_post_status_viewable filter
-----------------------------------------------+---------------------------
 Reporter:  peterwilsoncc                      |       Owner:
                                               |  hellofromTonya
     Type:  enhancement                        |      Status:  closed
 Priority:  normal                             |   Milestone:  5.9
Component:  Posts, Post Types                  |     Version:
 Severity:  normal                             |  Resolution:  fixed
 Keywords:  needs-patch needs-dev-note commit  |     Focuses:
-----------------------------------------------+---------------------------
Changes (by hellofromTonya):

 * status:  reviewing => closed
 * resolution:   => fixed


Comment:

 In [changeset:"52043" 52043]:
 {{{
 #!CommitTicketReference repository="" revision="52043"
 Posts/Post Types: Introduce 'is_post_status_viewable ' filter in
 `is_post_status_viewable()`.

 Introduces a new filter 'is_post_status_viewable' which allows overriding
 the check.

 The function's return signature is a boolean type. This commit ensures
 the return signature remains unchanged by requirinng a strict boolean
 type of the returned filtered value.

 Why?
 * To maintain this signature and backwards-compatibility.
 * To future prepare for PHP 8.1 and beyond.

 An explanation is included in the filter's DocBlock.

 Follow-up to [50130].

 Props audrasjb, hellofromTonya, peterwilsoncc.
 Fixes #54375.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54375#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list