Skip to content

Commit

Permalink
Nav/Taxonomies: also check for ::show_ui
Browse files Browse the repository at this point in the history
This ensures that taxonomies such as Post Formats do not unintentionally appear in the navigation when using post-type-support.
  • Loading branch information
JJJ committed Feb 10, 2022
1 parent 8053fe7 commit 5798a18
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sugar-calendar/includes/admin/nav.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ function display() {
if ( ! empty( $taxonomies ) ) {
foreach ( $taxonomies as $tax ) {

// Skip if private
if ( empty( $tax->public ) ) {
// Skip if private or invisible
if ( empty( $tax->public ) || empty( $tax->show_ui ) ) {
continue;
}

Expand Down Expand Up @@ -246,7 +246,7 @@ function taxonomy_tabs() {

// Get taxonomies
$taxonomy = sanitize_key( $taxnow );
$post_type = sugar_calendar_get_event_post_type_id();
$post_type = sugar_calendar_allowed_post_types();
$taxonomies = sugar_calendar_get_object_taxonomies( $post_type );

// Bail if current taxonomy is not an event taxonomy
Expand Down

0 comments on commit 5798a18

Please sign in to comment.