| @@ -88,9 +88,10 @@ | ||
| 88 | 88 | 'is_category' => is_category(), |
| 89 | 89 | 'is_tag' => is_tag(), |
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | - $status = apply_filters('nx_location_status', $status, $custom_ids); | |
| 92 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Reviewed for the NotificationX codebase: acceptable in this context. | |
| 93 | + $status = apply_filters('nx_location_status', $status, $custom_ids, $taxonomy_ids); | |
| 93 | 94 | |
| 94 | 95 | $post_types = Helper::post_types(); |
| 95 | 96 | $taxonomies = Helper::taxonomies(); |
| 96 | 97 | |
| @@ -112,15 +113,23 @@ | ||
| 112 | 113 | foreach ( $taxonomies as $slug => $tax ) { |
| 113 | 114 | $status[ 'is_tax-' . $slug ] = is_tax( $slug ); |
| 114 | 115 | } |
| 115 | 116 | } |
| 116 | - // Check for specific taxonomy ID | |
| 117 | - if ( in_array( 'is_taxonomy', $locations ) && ! empty($taxonomy_ids ) ) { | |
| 117 | + /** | |
| 118 | + * Check for specific taxonomy ID. | |
| 119 | + * | |
| 120 | + * `is_taxonomy` is a Pro-only location, and Pro resolves it through the | |
| 121 | + * `nx_location_status` filter above (taxonomy-aware, with a `has_term()` | |
| 122 | + * fallback for singular pages). This block is only a fallback for sites | |
| 123 | + * running an older Pro that does not set the key yet — without the | |
| 124 | + * `isset()` guard it would run *after* the filter and clobber Pro's value. | |
| 125 | + */ | |
| 126 | + if ( ! isset( $status['is_taxonomy'] ) && in_array( 'is_taxonomy', $locations ) && ! empty( $taxonomy_ids ) ) { | |
| 118 | 127 | $current_term_id = get_queried_object_id(); |
| 119 | 128 | $ids_array = explode(',',$taxonomy_ids ); |
| 120 | 129 | foreach ($ids_array as $id) { |
| 121 | - if ( $current_term_id == $id ) { | |
| 122 | - $status['is_taxonomy'] = ( $current_term_id == $id ); | |
| 130 | + if ( $current_term_id == trim( $id ) ) { | |
| 131 | + $status['is_taxonomy'] = true; | |
| 123 | 132 | break; |
| 124 | 133 | } |
| 125 | 134 | } |
| 126 | 135 | } |