Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save deckerweb/397b0a6994a265d43a7c1944e105637c to your computer and use it in GitHub Desktop.
Save deckerweb/397b0a6994a265d43a7c1944e105637c to your computer and use it in GitHub Desktop.
Snippet to add post state to a WordPress page
<?php
//======================================================================
// Add post state to the projects page
//======================================================================
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {
if( $post->post_name == 'edit-profile' ) {
$post_states[] = 'Profile edit page';
}
return $post_states;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment