Make WordPress Core


Ignore:
Timestamp:
08/13/2022 10:42:12 PM (2 years ago)
Author:
johnbillion
Message:

Taxonomy: Introduce the is_term_publicly_viewable() function.

This is the taxonomy term counterpart to the is_post_publicly_viewable() function. Although the logic for terms is more straight forward this serves the same purpose as introducing the corresponding function for posts -- to centralise and reduce the logic needed to validate a term and determine if it's publicly viewable.

Props peterwilsoncc, costdev, johnbillion

Fixes #56215

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/admin-bar.php

    r53745 r53893  
    810810        } elseif ( 'term' === $current_screen->base && isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag ) ) {
    811811            $tax = get_taxonomy( $tag->taxonomy );
    812             if ( is_taxonomy_viewable( $tax ) ) {
     812            if ( is_term_publicly_viewable( $tag ) ) {
    813813                $wp_admin_bar->add_node(
    814814                    array(
Note: See TracChangeset for help on using the changeset viewer.