CMB2::current_object_type PHP Метод

current_object_type() публичный Метод

Get the object type for the current page, based on the $pagenow global.
С версии: 2.2.2
public current_object_type ( ) : string
Результат string Page object type name.
    public function current_object_type()
    {
        global $pagenow;
        $type = 'post';
        if (in_array($pagenow, array('user-edit.php', 'profile.php', 'user-new.php'), true)) {
            $type = 'user';
        }
        if (in_array($pagenow, array('edit-comments.php', 'comment.php'), true)) {
            $type = 'comment';
        }
        if (in_array($pagenow, array('edit-tags.php', 'term.php'), true)) {
            $type = 'term';
        }
        return $type;
    }