WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is in reference to another answer here on wordpress.stackexchange. The answerer used the filename as the hook to enqueue scripts and styles to certain pages.

add_action( 'admin_print_scripts-post-new.php', 'portfolio_admin_script', 11 );
add_action( 'admin_print_scripts-post.php', 'portfolio_admin_script', 11 );
share|improve this question
up vote 7 down vote accepted

The short answer is 'yes'.

Taken from this article the suffix of those 'screen specific hooks' is given by:

  • For custom admin pages added via add_menu_page() - including settings pages - (and related functions) it is the screen ID (the value returned by add_menu_page())
  • For the admin page listing posts of any post type, it is edit.php
  • On the ‘add new’ page of any post type, it is post-new.php
  • On the edit page of any post type, it is post.php
  • For taxonomy pages it is edit-tags.php

You may find this plug-in useful, developed by @Kaiser, based on the article linked to above.

share|improve this answer
You know how to get upvotes ;) - Note for later readers: The plugin was based on a concept developed by @StephenHarris. – kaiser Nov 26 '12 at 2:41
This is exactly what I needed, thanks! :) – Nicholas Pickering Nov 26 '12 at 2:58
If you look at the source of any admin page there is a a little bit of Javascript near the top that reveals those hook names, or enough of them that you can work out the rest, and a few other things. – s_ha_dum Nov 26 '12 at 5:10

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.