[wp-trac] [WordPress Trac] #4639: action admin_print_scripts- isnt fired for plugins which reside in a subdir.

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 15 09:50:46 GMT 2007


#4639: action admin_print_scripts- isnt fired for plugins which reside in a
subdir.
----------------------------+-----------------------------------------------
 Reporter:  DD32            |       Owner:  anonymous
     Type:  defect          |      Status:  new      
 Priority:  normal          |   Milestone:           
Component:  Administration  |     Version:  2.3      
 Severity:  normal          |    Keywords:           
----------------------------+-----------------------------------------------
 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.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/4639>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list