[wp-trac] [WordPress Trac] #21454: Admin menu top label linked to sub pages screen id?
WordPress Trac
wp-trac at lists.automattic.com
Thu Aug 2 13:37:33 UTC 2012
#21454: Admin menu top label linked to sub pages screen id?
----------------------------+-----------------------------
Reporter: CoenJacobs | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version:
Severity: normal | Keywords:
----------------------------+-----------------------------
Practical case: Within WooCommerce we allow the user to translate the main
admin menu label, which says 'WooCommerce' by default. When this label is
translated, it also changes the `$screen->id` property of the child pages.
What used to be 'woocommerce_page_woocommerce_reports' is now
'boutique_page_woocommerce_status' (after translating to French) for
example.
We want to continue offering to translate this and have a workaround to
detect the correct subpage (for including stylesheets, javascripts on
specific pages only), by using PHP's strstr. But I feel the ultimate goal,
which allows a more 'clean' way is to be able to lock the id of the top
level menu. This allows cleaner detection of screens based on
`screen->id`s (which shouldn't change because of localisation) .
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21454>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list