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;
}
?>
Written by Joel Kuzmarski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Function
Authors
Chip Castle
21.64K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#