src/Metabox/Metabox.php
public function display($post_type, $post)
    {
        if (! is_null($this->capability) && ! current_user_can($this->capability)) {
            return;
        }

        if (! $this->hasTemplateForPost($post)) {
            return;
        }

        $this->filter->add('admin_body_class', function ($classes) {
            if (false !== strrpos($classes, 'themosis')) {
                return $classes;
            }

            $classes.= ' themosis';

            return $classes;
        });

        add_meta_box(
            $this->getId(),
            $this->getTitle(),
            [$this, 'render'],
            $this->getScreen(),
            $this->getContext(),
            $this->getPriority(),
            $this->getArguments()
        );
    }
public function display($post_type, $post)
    {
        if (! is_null($this->capability) && ! current_user_can($this->capability)) {
            return;
        }

        if (! $this->hasTemplateForPost($post)) {
            return;
        }

        $this->filter->add('admin_body_class', function ($classes) {
            if (false !== strrpos($classes, 'themosis')) {
                return $classes;
            }

            $classes.= ' themosis';

            return $classes;
        });

        add_meta_box(
            $this->getId(),
            $this->getTitle(),
            [$this, 'render'],
            $this->getScreen(),
            $this->getContext(),
            $this->getPriority(),
            $this->getArguments()
        );
    }
public function display ( $ post_type , $ post ) { if ( ! is_null ( $ this -> capability ) && ! current_user_can ( $ this -> capability ) ) { return ; } if ( ! $ this -> hasTemplateForPost ( $ post ) ) { return ; } $ this -> filter -> add ( 'admin_body_class' , function ( $ classes ) { if ( false !== strrpos ( $ classes , 'themosis' ) ) { return $ classes ; } $ classes .= ' themosis' ; return $ classes ; } ) ; add_meta_box ( $ this -> getId ( ) , $ this -> getTitle ( ) , [ $ this , 'render' ] , $ this -> getScreen ( ) , $ this -> getContext ( ) , $ this -> getPriority ( ) , $ this -> getArguments ( ) ) ; }
Handle "add_meta_boxes" hook and display the metabox.

@param string   $post_type
@param \WP_Post $post
Handle add_meta_boxes hook and display the metabox .