You can stop executing the function if the post is not of a specific post type. You can use get_post_type()
for this.
if( 'masters' != get_post_type( $post_id ) )
return;
You can stop executing the function if the post is not of a specific post type. You can use get_post_type()
for this.
if( 'masters' != get_post_type( $post_id ) )
return;