[wp-hackers] custom post type post editor add_action script targetting

Philip M. Hofer (Frumph) philip at frumph.net
Mon Nov 8 16:05:01 UTC 2010


I'm trying to target the edit page for a specific post type for 
add_action('admin_print_scripts-' .<location here>

So that the scripts do not load on every admin page, unfortunately i'm just 
*not* getting it how to target that;  I can do it using $_GET['page'] for 
*other* pages or even the hook for the add_submenu_page, unfortunately 
specifically the edit page gets generated from within core and no idea the 
hook.

hrm.. should I do if ($post->post_type == '<posttypename>') ?   but then it 
would hit some of the other admin pages when it shouldn't; $post gets 
generated with some defaults since its blank with the "add new posttype" 
page; blah.

Any ideas?

- Phil


Also, var_dump($wp_query) of course is coming out null, so what would I use 
to check the created variables for those edit pages to see what I could use 
as a specific?







More information about the wp-hackers mailing list