How to add JavaScript to the WordPress Admin and Keep it on One Page

This content is restricted to buyers.

Curtis McHale

Posts Twitter Google+

Curtis is a web designer/developer specialized in WordPress eCommerce development on WooCommerce. You can get in touch with him about projects on SFNdesign.
My Blog is 4 Times Faster Than Your Blog

4 responses to How to add JavaScript to the WordPress Admin and Keep it on One Page

  1. Haven’t known about the get_current_screen function. I used to use $page_now, $type_now and global $post to check the current admin page. Will try the get_current_screen, it looks cool.

    • The action also passes a `$hook` parameter as well. This can be used to easily make it enqueue only on a post your editing (not a new post via the ‘Add New’ button). I’ll have to do a follow up that shows the hook as well.

Trackbacks and Pingbacks:

  1. Adding JS to the WordPress Admin, and keeping it on one Page : Post Status - February 1, 2013

    [...] Adding JS to the WordPress Admin, and keeping it on one Page » [...]

  2. Getting Started with WordPress Development - WP Theme Tutorial - July 2, 2014

    […] Make sure you limit your admin scripts to only the page you need them on. […]

Leave a Reply

*

Text formatting is available via select HTML.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>