Label Special Pages in the Pages List
Adds labels such as "Contact form" or "Landing page" next to chosen pages in the Pages list, the same way WordPress marks the front page, so editors know which pages matter.
Opens WPIDE on
Code
// Page ID => label.
$wpide_page_labels = array(
2 => 'Contact form',
// 45 => 'Landing page',
);
add_filter( 'display_post_states', function ( $states, $post ) use ( $wpide_page_labels ) {
if ( isset( $wpide_page_labels[ $post->ID ] ) ) {
$states[ 'wpide_' . $post->ID ] = esc_html( $wpide_page_labels[ $post->ID ] );
}
return $states;
}, 10, 2 );
Notes
Map page IDs to labels in $wpide_page_labels; find an ID by hovering the page's Edit link.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.