WC_Admin_Menus::__construct
Hook in tabs.
Method of the class: WC_Admin_Menus{}
Hooks from the method
Returns
null. Nothing (null).
Usage
$WC_Admin_Menus = new WC_Admin_Menus(); $WC_Admin_Menus->__construct();
WC_Admin_Menus::__construct() WC Admin Menus:: construct code WC 10.6.2
public function __construct() {
// Add menus.
add_action( 'admin_menu', array( $this, 'menu_highlight' ) );
add_action( 'admin_menu', array( $this, 'menu_order_count' ) );
add_action( 'admin_menu', array( $this, 'maybe_add_new_product_management_experience' ) );
add_action( 'admin_menu', array( $this, 'admin_menu' ), 9 );
add_action( 'admin_menu', array( $this, 'orders_menu' ), 9 );
add_action( 'admin_menu', array( $this, 'reports_menu' ), 20 );
add_action( 'admin_menu', array( $this, 'settings_menu' ), 50 );
add_action( 'admin_menu', array( $this, 'status_menu' ), 60 );
/**
* Controls whether we add a submenu item for the WooCommerce Addons page.
* Woo Express uses this filter.
*
* @since 8.2.1
*
* @param bool $show_addons_page If the addons page should be included.
*/
if ( apply_filters( 'woocommerce_show_addons_page', true ) ) {
$container = wc_get_container();
$container->get( Marketplace::class );
add_action( 'admin_menu', array( $this, 'addons_my_subscriptions' ), 70 );
}
add_filter( 'menu_order', array( $this, 'menu_order' ) );
add_filter( 'custom_menu_order', array( $this, 'custom_menu_order' ) );
add_filter( 'set-screen-option', array( $this, 'set_screen_option' ), 10, 3 );
// Add endpoints custom URLs in Appearance > Menus > Pages.
add_action( 'admin_head-nav-menus.php', array( $this, 'add_nav_menu_meta_boxes' ) );
// Admin bar menus.
if ( apply_filters( 'woocommerce_show_admin_bar_visit_store', true ) ) {
add_action( 'admin_bar_menu', array( $this, 'admin_bar_menus' ), 31 );
}
// Handle saving settings earlier than load-{page} hook to avoid race conditions in conditional menus.
add_action( 'wp_loaded', array( $this, 'save_settings' ) );
}