public static function get_instance( $post_id ) {
global $wpdb;
- $post_id = (int) $post_id;
- if ( ! $post_id )
+ if ( ! is_numeric( $post_id ) || $post_id != floor( $post_id ) || ! $post_id ) {
return false;
+ }
+
+ $post_id = (int) $post_id;
$_post = wp_cache_get( $post_id, 'posts' );
return true;
if ( 'page_template' == $key )
- return ( 'page' == $this->post_type );
+ return true;
if ( 'post_category' == $key )
return true;