public static function getPostTypeByPostObject() { if (isset($GLOBALS['post']->post_type) && $GLOBALS['post']->post_type) { return $GLOBALS['post']->post_type; } }