add post-state

add post-state
add_filter( 'display_post_states', 'ecs_add_post_state', 10, 2 );
function ecs_add_post_state( $post_states, $post ) {

	if( get_page_template_slug( $post ) == 'view/tpl-news.php' ){
		$post_states['page_for_news_template'] = esc_html__('News template', 'greyowl');
	}

	return $post_states;
}
category: Code

Leave a Reply

Your email address will not be published. Required fields are marked *