[wp-trac] [WordPress Trac] #56215: Introduce `is_term_publicly_viewable()` function

WordPress Trac noreply at wordpress.org
Wed Jul 13 22:30:02 UTC 2022


#56215: Introduce `is_term_publicly_viewable()` function
--------------------------------------+------------------------------
 Reporter:  johnbillion               |       Owner:  (none)
     Type:  enhancement               |      Status:  new
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Taxonomy                  |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------

Comment (by johnbillion):

 Before:

 {{{#!php
 $term = get_term( $term_id );

 if ( ( $term instanceof WP_Term ) && is_taxonomy_viewable( $term->taxonomy
 ) ) {
     $link = get_term_link( $term_id );
 }
 }}}

 After:

 {{{#!php
 if ( is_term_publicly_viewable( $term_id ) ) {
     $link = get_term_link( $term_id );
 }
 }}}

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


More information about the wp-trac mailing list