src/WPametu/UI/Admin/EditMetaBox.php
public function add_meta_boxes($post_type, $post){
        if( $this->is_valid_post_type($post_type) && $this->has_cap() ){
            if( empty($this->name) || empty($this->label) ){
                $message = sprintf($this->__('<code>%s</code> has invalid name or label.'), get_called_class());
                add_action('admin_notices', function() use ($message) {
                    printf('<div class="error"><p>%s</p></div>', $message);
                });
            }else{
                add_meta_box($this->name, $this->label, [$this, 'render'], $post_type, $this->context, $this->priority);
            }
        }
    }
public function add_meta_boxes($post_type, $post){
        if( $this->is_valid_post_type($post_type) && $this->has_cap() ){
            if( empty($this->name) || empty($this->label) ){
                $message = sprintf($this->__('<code>%s</code> has invalid name or label.'), get_called_class());
                add_action('admin_notices', function() use ($message) {
                    printf('<div class="error"><p>%s</p></div>', $message);
                });
            }else{
                add_meta_box($this->name, $this->label, [$this, 'render'], $post_type, $this->context, $this->priority);
            }
        }
    }
public function add_meta_boxes ( $ post_type , $ post ) { if ( $ this -> is_valid_post_type ( $ post_type ) && $ this -> has_cap ( ) ) { if ( empty ( $ this -> name ) || empty ( $ this -> label ) ) { $ message = sprintf ( $ this -> __ ( '<code>%s</code> has invalid name or label.' ) , get_called_class ( ) ) ; add_action ( 'admin_notices' , function ( ) use ( $ message ) { printf ( '<div class="error"><p>%s</p></div>' , $ message ) ; } ) ; } else { add_meta_box ( $ this -> name , $ this -> label , [ $ this , 'render' ] , $ post_type , $ this -> context , $ this -> priority ) ; } } }
Register meta box

@param string $post_type
@param \WP_Post $post
Register meta box