Do WordPress Core Filenames Work as Hooks?

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.

Leave a Comment