public function isForPostType(string $post_type = ''): bool
    {
        if (!$this->Wp->is_admin) {
            return false; // Not applicable.
        } elseif (!($current = $this->current())) {
            return false; // Nope.
        } elseif (!($current_post_type = $this->currentPostType())) {
            return false; // Nope.
        } elseif (!in_array($current, ['post-new.php', 'post.php', 'edit.php', 'edit-tags.php'], true)) {
            return false; // Nope.
        }
        if (!$post_type) {
            return true; // Simple check.
        }
        if ($post_type[0] === '/') {
            $regex = $post_type; // Treat as regex.
        } else {
            $regex = '/^'.$this->c::wregxFrag($post_type, '_').'$/ui';
        }
        return (bool) preg_match($regex, $current_post_type);
    }
public function isForPostType(string $post_type = ''): bool
    {
        if (!$this->Wp->is_admin) {
            return false; // Not applicable.
        } elseif (!($current = $this->current())) {
            return false; // Nope.
        } elseif (!($current_post_type = $this->currentPostType())) {
            return false; // Nope.
        } elseif (!in_array($current, ['post-new.php', 'post.php', 'edit.php', 'edit-tags.php'], true)) {
            return false; // Nope.
        }
        if (!$post_type) {
            return true; // Simple check.
        }
        if ($post_type[0] === '/') {
            $regex = $post_type; // Treat as regex.
        } else {
            $regex = '/^'.$this->c::wregxFrag($post_type, '_').'$/ui';
        }
        return (bool) preg_match($regex, $current_post_type);
    }
public function isForPostType ( string $ post_type = '' ) : bool { if ( ! $ this -> Wp -> is_admin ) { return false ; // Not applicable. } elseif ( ! ( $ current = $ this -> current ( ) ) ) { return false ; // Nope. } elseif ( ! ( $ current_post_type = $ this -> currentPostType ( ) ) ) { return false ; // Nope. } elseif ( ! in_array ( $ current , [ 'post-new.php' , 'post.php' , 'edit.php' , 'edit-tags.php' ] , true ) ) { return false ; // Nope. } if ( ! $ post_type ) { return true ; // Simple check. } if ( $ post_type [ 0 ] === '/' ) { $ regex = $ post_type ; // Treat as regex. } else { $ regex = '/^' . $ this -> c :: wregxFrag ( $ post_type , '_' ) . '$/ui' ; } return ( bool ) preg_match ( $ regex , $ current_post_type ) ; }
Is a menu page for a post type?

@since 160524 Menu page utils.

@param string $post_type Post type to check (optional).

- `*` = Zero or more chars != `_`.
- `**` = Zero or more chars of any kind.
- Check is always caSe insensitive by default.
- If `$post_type` beings with `/` it is treated as regex.

@return bool True if menu page is for post type.
Is a menu page for a post type?