WC_Admin_Menus::maybe_add_new_product_management_experience()publicWC 1.0

Maybe add new management product experience.

Method of the class: WC_Admin_Menus{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Menus = new WC_Admin_Menus();
$WC_Admin_Menus->maybe_add_new_product_management_experience();

WC_Admin_Menus::maybe_add_new_product_management_experience() code WC 8.7.0

public function maybe_add_new_product_management_experience() {
	if ( Features::is_enabled( 'new-product-management-experience' ) || FeaturesUtil::feature_is_enabled( 'product_block_editor' ) ) {
		global $submenu;
		if ( isset( $submenu['edit.php?post_type=product'][10] ) ) {
			// Disable phpcs since we need to override submenu classes.
			// Note that `phpcs:ignore WordPress.Variables.GlobalVariables.OverrideProhibited` does not work to disable this check.
			// phpcs:disable
			$submenu['edit.php?post_type=product'][10][2] = 'admin.php?page=wc-admin&path=/add-product';
			// phps:enableWordPress.Variables.GlobalVariables.OverrideProhibited
		}
	}
}