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