[wp-trac] [WordPress Trac] #27732: admin_enqueue_scripts hook & internationalization: inconsistent $hook
WordPress Trac
noreply at wordpress.org
Wed Apr 9 08:48:47 UTC 2014
#27732: admin_enqueue_scripts hook & internationalization: inconsistent $hook
----------------------------+-----------------------------
Reporter: websupporter | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 3.8.1
Severity: normal | Keywords:
Focuses: administration |
----------------------------+-----------------------------
Hi everyone,
I am not quite sure, if it is already reported or wether it is a bug at
all, but I think so.
Okay:
I register an admin_page like this:
{{{
add_menu_page( __( 'Menu Title', 'textdomain' ), __( 'Menu Title',
'textdomain' ), 'edit_posts', 'slug', 'admin_output_index', $url .
'icon.png', 81 );
}}}
The second parameter "( 'Menu Title', 'textdomain' );" is used in /wp-
admin/includes/plugin.php, L 983 to produce a hook:
{{{
$admin_page_hooks[$menu_slug] = sanitize_title( $menu_title )
}}}
Which then is used for example as $hook, when I want to register scripts
only for my plugin page:
{{{
admin_enqueue_scripts( $hook )
}}}
So $hook is inconsistent.
But maybe, I am getting something wrong. Thanks for having a look.
All the best!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/27732>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list