wc_get_screen_ids()
Get all WooCommerce screen ids. Note, among other things, this is used to conditionally load some assets. See class-wc-admin-assets.php.
Hooks from the function
Returns
Array.
Usage
wc_get_screen_ids();
wc_get_screen_ids() wc get screen ids code WC 10.6.2
function wc_get_screen_ids() {
$wc_screen_id = 'woocommerce';
$screen_ids = array(
'toplevel_page_' . $wc_screen_id,
$wc_screen_id . '_page_wc-orders',
$wc_screen_id . '_page_wc-reports',
$wc_screen_id . '_page_wc-shipping',
$wc_screen_id . '_page_wc-settings',
$wc_screen_id . '_page_wc-status',
$wc_screen_id . '_page_wc-addons',
'toplevel_page_wc-reports',
'product_page_product_attributes',
'product_page_product_exporter',
'product_page_product_importer',
'product_page_product-reviews',
'edit-product',
'product',
'edit-shop_coupon',
'shop_coupon',
'edit-product_cat',
'edit-product_tag',
'edit-product-brand',
'profile',
'user-edit',
);
foreach ( wc_get_order_types() as $type ) {
$screen_ids[] = $type;
$screen_ids[] = 'edit-' . $type;
$screen_ids[] = wc_get_page_screen_id( $type );
}
$attributes = wc_get_attribute_taxonomies();
if ( $attributes ) {
foreach ( $attributes as $attribute ) {
$screen_ids[] = 'edit-' . wc_attribute_taxonomy_name( $attribute->attribute_name );
}
}
/* phpcs:disable WooCommerce.Commenting.CommentHooks.MissingHookComment */
return apply_filters( 'woocommerce_screen_ids', $screen_ids );
/* phpcs: enable */
}