Answers for "show which post type wordpress"

PHP
5

wordpres get_posttype

if ( get_post_type( get_the_ID() ) == 'slug_post_type' ) {
    //if is true
}
Posted by: Guest on June-17-2020
0

check backend post type

function this_screen() {
  $current_screen = get_current_screen();
  if( $current_screen ->id === "page" ) {
    include_once 'page_admin.php';
  }
}
add_action( 'current_screen', 'this_screen' );
Posted by: Guest on April-15-2020

Code answers related to "show which post type wordpress"

Browse Popular Code Answers by Language