Taxonomy: Introduce is_taxonomy_viewable().

This utility function allows for easy detection whether terms for a taxonomy are considered publicly viewable.

Props andizer.
Fixes #44466.


git-svn-id: https://develop.svn.wordpress.org/trunk@43386 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Felix Arntz
2018-07-03 10:28:39 +00:00
parent 8e96abbcc2
commit d3a198df34
4 changed files with 65 additions and 2 deletions
+1 -1
View File
@@ -728,7 +728,7 @@ function wp_admin_bar_edit_menu( $wp_admin_bar ) {
} elseif ( 'term' == $current_screen->base
&& isset( $tag ) && is_object( $tag ) && ! is_wp_error( $tag )
&& ( $tax = get_taxonomy( $tag->taxonomy ) )
&& $tax->public ) {
&& is_taxonomy_viewable( $tax ) ) {
$wp_admin_bar->add_menu(
array(
'id' => 'view',