According to Make WordPress Themes all themes must use the action
admin_enqueue_script-appearance_page_$menu_slugto enqueue scripts and styles for theme pages in the admin.
For some reason, I can’t get this to work. I’ve created an admin page with the slug origin-styles. I’ve added an action for it using
origin_enqueue_functionis never called.
I did a full regex search of wp-admin (WordPress 3.4 Beta 4) and the only place an action is called with the string “admin_enqueue_script” in it is on line 68 of admin-header.php. To test, I added the following line to
origin_enqueue_functionstarted being called after I added this.
Am I missing something here, or is using the action admin_enqueue_scripts still the only way to enqueue scripts for a theme admin page?
- The topic ‘Enqueueing Scripts for Theme Admin Pages’ is closed to new replies.