[wp-trac] [WordPress Trac] #37462: Introduce is_private() conditional

WordPress Trac noreply at wordpress.org
Wed Aug 7 09:20:38 UTC 2019


#37462: Introduce is_private() conditional
-------------------------------+-----------------------
 Reporter:  sillybean          |       Owner:  (none)
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  has-patch          |     Focuses:  template
-------------------------------+-----------------------
Changes (by donmhico):

 * keywords:  needs-patch needs-unit-tests => has-patch


Comment:

 My attached patch,
 [https://core.trac.wordpress.org/attachment/ticket/37462/37462.diff
 37462.diff], introduced a new function - `is_private_post( $post )` -
 which returns `true` if the `$post` passed is `private` and `false` if
 otherwise. It uses the function `get_post_status()`.

 Reference:
 https://developer.wordpress.org/reference/functions/get_post_status/

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


More information about the wp-trac mailing list