Ticket #4639 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

action admin_print_scripts- isnt fired for plugins which reside in a subdir.

Reported by: DD32 Assigned to: anonymous
Priority: normal Milestone: 2.3
Component: Administration Version: 2.3
Severity: normal Keywords: admin_print_scripts get_plugin_page_hook has-patch
Cc:

Description

admin-header.php:

if ( isset($page_hook) )
	do_action('admin_print_scripts-' . $page_hook);
else if ( isset($plugin_page) )
	do_action('admin_print_scripts-' . $plugin_page);

For plugins which reside in a subdirectory (ie. /wp-content/plugins/plugin_name/plugin.php), the admin_print_scripts- action doesnt fire, The problem is that $page_hook is a 0 character string, however IS set.

Theres 2 options i can see, correcting the function which assigns to $page_hook, or testing for isset() && ! empty()

Attached is a patch to modify get_plugin_page_hook() to return null insead of , this causes $page_hook to "not be set" which in turn, causes the print scripts hook to correctly run.

Attachments

4639.get_plugin_page_hook.patch (466 bytes) - added by DD32 on 07/15/07 09:51:23.
get_plugin_page_hook fix
4639.get_plugin_page_hook.diff (466 bytes) - added by DD32 on 07/15/07 09:52:39.
get_plugin_page_hook fix as diff instead

Change History

07/15/07 09:51:23 changed by DD32

  • attachment 4639.get_plugin_page_hook.patch added.

get_plugin_page_hook fix

07/15/07 09:52:39 changed by DD32

  • attachment 4639.get_plugin_page_hook.diff added.

get_plugin_page_hook fix as diff instead

07/15/07 09:53:49 changed by DD32

  • keywords set to admin_print_scripts get_plugin_page_hook.

Apologies for the 2 different format patches/diffs, the HTML viewer didnt work for the .patch file, so i thought it only accepted .diff, but that isnt working either.

07/15/07 16:33:00 changed by Nazgul

  • keywords changed from admin_print_scripts get_plugin_page_hook to admin_print_scripts get_plugin_page_hook has-patch.
  • milestone set to 2.3 (trunk).

07/15/07 17:59:05 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [5803]) Return hook as null instead of empty string. Props DD32. fixes #4639