WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#27732 closed defect (bug) (duplicate)

admin_enqueue_scripts hook & internationalization: inconsistent $hook

Reported by: websupporter Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.8.1
Component: Plugins Keywords:
Focuses: administration Cc:

Description

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!

Change History (1)

#1 @ocean90
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #18857.

Note: See TracTickets for help on using tickets.