get_by( array( 'id' => $wp_post->post_name ) ); $fields = is_array( $fields ) && count( $fields ) > 0 ? array_shift( $fields ) : null; $fields = is_object( $fields ) && property_exists( $fields, 'meta_box' ) && is_array( $fields->meta_box ) ? $fields->meta_box : array(); return arr( $fields, 'fields' ); } /** * @param mixed[] $field */ protected function fill_field_id_and_type( array $field, string &$field_id, string &$field_type ): void { $field_id = string( $field, 'id' ); $field_type = string( $field, 'type' ); } public function add_tab_to_meta_group(): void { self::add_action( 'add_meta_boxes', function (): void { add_meta_box( 'advanced_views', $this->get_tab_label(), array( $this, 'render_meta_box' ), $this->get_vendor_post_type(), 'side' ); } ); } public function render_meta_box( WP_Post $wp_post ): void { $this->print_related_acf_views( $wp_post ); } public function get_vendor_name(): string { return Meta_Box_Data_Vendor::NAME; } }