original_string: 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);
              }
          }
      }
code: 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);
              }
          }
      }
code_tokens: 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 ) ; } } }
docstring: Register meta box
  
  @param string $post_type
  @param \WP_Post $post
docstring_tokens: Register meta box