Forked from petenelson/admin_head_post_edit_check.php
Last active
April 28, 2020 14:19
-
-
Save agrogeek/22755209c1581a46f0d5310265ad11cd to your computer and use it in GitHub Desktop.
WordPress admin action hooks for listing/adding/editing posts or pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* actions fired when listing/adding/editing posts or pages */ | |
/* admin_head-(hookname) to head include */ | |
/* admin_footer-(hookname) to footer include */ | |
add_action( 'admin_head-post.php', 'admin_head_post_editing' ); | |
add_action( 'admin_head-post-new.php', 'admin_head_post_new' ); | |
add_action( 'admin_head-edit.php', 'admin_head_post_listing' ); | |
function admin_head_post_editing() { | |
echo 'you are editing a post'; | |
} | |
function admin_head_post_new() { | |
echo 'you are adding a post'; | |
} | |
function admin_head_post_listing() { | |
// sample code, handy for custom post types | |
global $post_type; | |
echo 'you are listing posts, post_type: ' . $post_type ; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment