wc_get_screen_ids

Get all WooCommerce screen ids.

Description

(array) wc_get_screen_ids(); 

Returns (array)


Usage

  1. if ( !function_exists( 'wc_get_screen_ids' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/admin/wc-admin-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wc_get_screen_ids(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/admin/wc-admin-functions.php  
  1. function wc_get_screen_ids() { 
  2.  
  3. $wc_screen_id = sanitize_title( __( 'WooCommerce', woocommerce ) ); 
  4. $screen_ids = array( 
  5. 'toplevel_page_' . $wc_screen_id,  
  6. $wc_screen_id . '_page_wc-reports',  
  7. $wc_screen_id . '_page_wc-shipping',  
  8. $wc_screen_id . '_page_wc-settings',  
  9. $wc_screen_id . '_page_wc-status',  
  10. $wc_screen_id . '_page_wc-addons',  
  11. 'toplevel_page_wc-reports',  
  12. 'product_page_product_attributes',  
  13. 'edit-product',  
  14. 'product',  
  15. 'edit-shop_coupon',  
  16. 'shop_coupon',  
  17. 'edit-product_cat',  
  18. 'edit-product_tag',  
  19. 'profile',  
  20. 'user-edit',  
  21. ); 
  22.  
  23. foreach ( wc_get_order_types() as $type ) { 
  24. $screen_ids[] = $type; 
  25. $screen_ids[] = 'edit-' . $type; 
  26.  
  27. return apply_filters( 'woocommerce_screen_ids', $screen_ids );