public function setup_meta_box() {
		$properties = $this->box->properties;

		// Check all properties and remove them that can't be rendered.
		foreach ( $properties as $index => $property ) {
			if ( $property instanceof Papi_Property && ! $property->can_render() ) {
				unset( $properties[$index] );
			}
		}

		// Bail if properties array is empty,
		// no need to render a empty meta box.
		if ( empty( $properties ) ) {
			return;
		}

		add_meta_box(
			$this->box->id,
			$this->get_title(),
			[$this, 'render_meta_box'],
			$this->get_post_type(),
			$this->box->context,
			$this->box->priority,
			$properties
		);
	}
public function setup_meta_box() {
		$properties = $this->box->properties;

		// Check all properties and remove them that can't be rendered.
		foreach ( $properties as $index => $property ) {
			if ( $property instanceof Papi_Property && ! $property->can_render() ) {
				unset( $properties[$index] );
			}
		}

		// Bail if properties array is empty,
		// no need to render a empty meta box.
		if ( empty( $properties ) ) {
			return;
		}

		add_meta_box(
			$this->box->id,
			$this->get_title(),
			[$this, 'render_meta_box'],
			$this->get_post_type(),
			$this->box->context,
			$this->box->priority,
			$properties
		);
	}
public function setup_meta_box ( ) { $ properties = $ this -> box -> properties ; // Check all properties and remove them that can't be rendered. foreach ( $ properties as $ index => $ property ) { if ( $ property instanceof Papi_Property && ! $ property -> can_render ( ) ) { unset ( $ properties [ $ index ] ) ; } } // Bail if properties array is empty, // no need to render a empty meta box. if ( empty ( $ properties ) ) { return ; } add_meta_box ( $ this -> box -> id , $ this -> get_title ( ) , [ $ this , 'render_meta_box' ] , $ this -> get_post_type ( ) , $ this -> box -> context , $ this -> box -> priority , $ properties ) ; }
Setup meta box.
Setup meta box .