[wp-trac] [WordPress Trac] #49628: Add is_post_type_viewable filter

WordPress Trac noreply at wordpress.org
Mon Nov 8 03:47:23 UTC 2021


#49628: Add is_post_type_viewable filter
---------------------------------------------+-----------------------------
 Reporter:  powerbuoy                        |       Owner:  hellofromTonya
     Type:  feature request                  |      Status:  closed
 Priority:  normal                           |   Milestone:  5.9
Component:  Posts, Post Types                |     Version:  5.3.2
 Severity:  normal                           |  Resolution:  fixed
 Keywords:  has-patch needs-dev-note commit  |     Focuses:  administration
---------------------------------------------+-----------------------------

Comment (by hellofromTonya):

 Inspiration hit me tonight inspired by @Cybr. This is a boolean return.
 Check it like this:

 {{{#!php
 <?php
 return true === apply_filters( 'post_type_viewable', $is_viewable,
 $post_type );
 }}}

 No type casting.
 No `is_bool()`conditional.

 What do you think @Cybr?

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


More information about the wp-trac mailing list