src/Metabox/Metabox.php
private function hasTemplateForPost(\WP_Post $post): bool
    {
        $postTemplate = get_post_meta($post->ID, '_wp_page_template', true);

        $templates = isset($this->template[$post->post_type]) ? $this->template[$post->post_type] : [];

        if (empty($templates)) {
            // No templates exist for the current post type so we let
            // pass through either in order to display the metabox.
            return true;
        }

        return in_array($postTemplate, $templates, true);
    }
private function hasTemplateForPost(\WP_Post $post): bool
    {
        $postTemplate = get_post_meta($post->ID, '_wp_page_template', true);

        $templates = isset($this->template[$post->post_type]) ? $this->template[$post->post_type] : [];

        if (empty($templates)) {
            // No templates exist for the current post type so we let
            // pass through either in order to display the metabox.
            return true;
        }

        return in_array($postTemplate, $templates, true);
    }
private function hasTemplateForPost ( \ WP_Post $ post ) : bool { $ postTemplate = get_post_meta ( $ post -> ID , '_wp_page_template' , true ) ; $ templates = isset ( $ this -> template [ $ post -> post_type ] ) ? $ this -> template [ $ post -> post_type ] : [ ] ; if ( empty ( $ templates ) ) { // No templates exist for the current post type so we let // pass through either in order to display the metabox. return true ; } return in_array ( $ postTemplate , $ templates , true ) ; }
Check if given post should use the template.

@param \WP_Post $post

@return bool
Check if given post should use the template .