WooCommerce: get_current_screen not working with multi language

I am developing a WooCommerce plugin and I am using get_current_screen to identify the current screen slug to load css and js.

But when using WooCommerce Branding plugin or any other language than English, the slug changes.

Read More

Eg : default slug will be like woocommerce-settings.
If using branding, then it changes like this wp-dev-settings.

I just wanted to know how I can identify the current screen slug ?

Related posts

Leave a Reply

2 comments

  1. You can identify the current screen slug from the ‘parent’ attribute of the screen object. For example, if my shop name via WC Branding plugin is “Vishals Shop”, then:

    [base] => vishals-shop_page_wc-settings
    [parent_base] => woocommerce

    Now you can replace the shop name with the parent_base & get the real slug name of that page.