diff --git a/CHANGELOG.md b/CHANGELOG.md index 73f8b1a98..b946d32c9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ item (Added, Changed, Depreciated, Removed, Fixed, Security). - Updated: Refactor Horizontal Tabs block into a dynamic block. Add reordering functionality. - Updated: Refactor Vertical Tabs block to dynamic block; allow sorting. +- Fixed: Admin menu order should now properly exclude predefined post types ## [2026.02] - Added: `moderntribe/tribe_embed` composer package v1.1.0. diff --git a/wp-content/plugins/core/src/Menus/Admin_Menu_Order.php b/wp-content/plugins/core/src/Menus/Admin_Menu_Order.php index ff25d4c55..9645962d3 100644 --- a/wp-content/plugins/core/src/Menus/Admin_Menu_Order.php +++ b/wp-content/plugins/core/src/Menus/Admin_Menu_Order.php @@ -49,20 +49,18 @@ public function custom_menu_order(): array { */ protected function get_post_types(): array { try { - $subscribers = tribe_project()->get_subscribers(); + // get all post type subscribers + $subscribers = array_filter( tribe_project()->get_subscribers(), static function ( $subscriber ) { + return str_contains( $subscriber, 'Post_Types\\' ); + } ); $post_types = []; foreach ( $subscribers as $subscriber ) { - // skip non-post types subscribers - if ( ! str_contains( $subscriber, 'Post_Types\\' ) ) { - continue; - } - + // there is no post subscriber so there's no need to define it here to skip $skip_post_types = [ - 'Post_Types\\Announcement', - 'Post_Types\\Page', - 'Post_Types\\Post', - 'Post_Types\\Training', + 'Tribe\\Plugin\\Post_Types\\Page\\Page_Subscriber', + 'Tribe\\Plugin\\Post_Types\\Training\\Training_Subscriber', + 'Tribe\\Plugin\\Post_Types\\Announcement\\Announcement_Subscriber', ]; // skip std / predefined post types