public static function set_post_type($posttype = false) { if (!$posttype) { global $typenow; $posttype = isset($typenow) && !empty($typenow) ? $typenow : false; } if ($posttype) { self::$post_type = get_post_type_object($posttype); } }