# depicter/trunk/app/src/Rules/Condition/CPT/IsArchive.php

Depicter — Popup &amp; Slider Builder, version trunk. 65 lines.

- Page: https://pluginprobe.com/plugins/depicter/trunk/code/app/src/Rules/Condition/CPT/IsArchive.php
- Raw: https://pluginprobe.com/plugins/depicter/trunk/raw/app/src/Rules/Condition/CPT/IsArchive.php
- Modified: 2025-12-27T08:49:18+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/depicter/trunk/code/app/src/Rules/Condition/CPT/IsArchive.php#L10-L20`.

```php
<?php

namespace Depicter\Rules\Condition\CPT;

use Averta\Core\Utility\Arr;
use Depicter\Rules\Condition\CPT\Base as CPTConditionBase;

class IsArchive extends CPTConditionBase
{
	/**
	 * @inheritdoc
	 */
	public $slug = 'CPT_IsArchive';

	/**
	 * @inheritdoc
	 */
	public $control = 'multiSelect';

	/**
	 * @inheritdoc
	 */
	protected $belongsTo = 'CPT';


	/**
	 * @inheritdoc
	 */
	public function getLabel(): ?string{
		return __( "Archive Page", 'depicter' );
	}

	/**
	 * @inheritDoc
	 */
	public function getControlOptions(){
		$options = parent::getControlOptions();

		$archiveOptions = [];
		foreach( $this->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;
	}
}

```
