[wp-trac] [WordPress Trac] #4563: actions `admin_print_scripts-*'
and `admin_head-*' useless
WordPress Trac
wp-trac at lists.automattic.com
Fri Jun 29 14:53:41 GMT 2007
#4563: actions `admin_print_scripts-*' and `admin_head-*' useless
----------------------------+-----------------------------------------------
Reporter: reedom | Owner: anonymous
Type: defect | Status: new
Priority: normal | Milestone:
Component: Administration | Version: 2.2.1
Severity: normal | Keywords: hooks
----------------------------+-----------------------------------------------
There are some problems.
1. The code doesn't consider of localized menu string.
`add_menu_page()` in `admin-functions.php` uses hook name from menu
title.[[br]]
so a hook of an option page's custom plugin menu in Japanese turns like:
`admin_head-%e8%a8%ad%e5%ae%9a_page_my-plugin_dir/my-plugin`
Not only gettext-ed string but also url encoded. Nonsense.
2. Non unique hooks `"admin_print_scripts-"` and `"admin_head-"`.
When plugins calls `add_options_page()` without the last argument(hook
function name), those hooks called just as literaly the above: without any
plugins name.[[br]]
I think the patch of ticket:3835 should be applied.[[br]]
For plugins like need to insert `<script>` tag only to their setting
page, `"admin_print_scripts-<my-plugin>"` hook is better than[[br]]
`"admin_print_scripts"`, I think.
--
Ticket URL: <http://trac.wordpress.org/ticket/4563>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list