Last Updated: February 25, 2016
·
945
· leoj3n

Definitively Verify (Custom) Post Type

Use this function...

<?php
function my_verify_post_type() {
  global $post_type;

  $type = 'movie'; // a custom P.T.

  if (isset( $_GET['post_type'] )
   && $_GET['post_type'] == $type
   || isset( $post_type ) && $post_type == $type) 
   return true; // return true if on a page of type $type

  return false;
}
?>