php#L95-L98 * @link https://github.com/WordPress/wordpress-develop/blob/6.0.3/src/wp-includes/post.php#L2067-L2076 * @link https://github.com/WordPress/wordpress-develop/blob/6.0.3/src/wp-includes/default-filters.php#L537 * * Taken together, when using the suggested `wc_admin_register_page` to add a submenu * under Marketing menu, if the priority of "admin_menu" action is > 6, it won't appear. * If the priority is <= 6, the order of added submenu will be above the Coupons. * When using the dedicated "woocommerce_marketing_menu_items" filter, the order of added * submenu will still be above the Coupons. * * In summary, the order in which submenus call `add_submenu_page` determines the order * in which they appear in the Marketing menu, and the way in which submenus call * `add_submenu_page` and whether they are called before the Marketing menu calls * `add_menu_page` determines whether the submenus can match the parent slug to appear * under Marketing menu. * * The method and order of calling is as follows: * 1. Overview submenu: PageController->register_page() with priority 5. * 2. Marketing menu: add_menu_page() with priority 6. * 3. Coupons submenu: add_submenu_page() with the default priority 10. * 4. This workaround will be this order if we add a submenu by "admin_menu" * action with a priority >= 10. Moreover, the `position` will be effective * to change the final ordering. * * @param array $options { * Array describing the submenu page. * * @type string id ID to reference the page. * @type string title Page title. Used in menus and breadcrumbs. * @type string parent Parent ID. * @type string path Path for this page. * @type string capability Capability needed to access the page. * @type int position|null Menu item position. * } */ protected function register_classic_submenu_page( $options ) { $defaults = [ 'capability' => 'manage_woocommerce', 'position' => null, ]; $options = wp_parse_args( $options, $defaults ); $options['js_page'] = true; if ( 0 !== strpos( $options['path'], PageController::PAGE_ROOT ) ) { $options['path'] = PageController::PAGE_ROOT . '&path=' . $options['path']; } add_submenu_page( $options['parent'], $options['title'], $options['title'], $options['capability'], $options['path'], [ PageController::class, 'page_wrapper' ], $options['position'], ); PageController::get_instance()->connect_page( $options ); } }
Fatal error: Trait "Automattic\WooCommerce\GoogleListingsAndAds\Menu\MenuFixesTrait" not found in /htdocs/wp-content/plugins/google-listings-and-ads/src/Menu/GetStarted.php on line 16