availablePostTypes as $postType ) { if ( $postType->name == 'product' ) { continue; } $archiveOptions[] = [ /* translators: singular name of post type */ 'label' => sprintf( __( '%s Archive', 'depicter' ), $postType->labels->singular_name ), 'value' => $postType->name ]; } return Arr::merge( $options, [ 'options' => $archiveOptions ]); } /** * @inheritdoc */ public function check( $value = null ): bool{ $isIncluded = !empty( $value ) ? is_post_type_archive( $value ) : is_archive(); return $this->selectionMode === 'include' ? $isIncluded : ! $isIncluded; } }