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

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

- Page: https://pluginprobe.com/plugins/depicter/trunk/code/app/src/Rules/Condition/WordPress/IsArchive.php
- Raw: https://pluginprobe.com/plugins/depicter/trunk/raw/app/src/Rules/Condition/WordPress/IsArchive.php
- Modified: 2024-01-29T10:15:28+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/WordPress/IsArchive.php#L10-L20`.

```php
<?php

namespace Depicter\Rules\Condition\WordPress;

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

class IsArchive extends ConditionBase
{
	/**
	 * @inheritdoc
	 */
	public $slug = 'WordPress_IsArchive';

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

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

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

	/**
	 * @inheritDoc
	 */
	public function getDescription(): ?string{
		return __( 'When any type of Archive page is being displayed. Category, Tag, Author and Date based pages are all types of Archives.', 'depicter' );
	}

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

		return Arr::merge( $options, [ 'options' => [
			[
				'label' => __( 'WP Archive Page', 'depicter' ),
				'value' => true
			]
		]]);
	}

	/**
	 * @inheritdoc
	 */
	public function check( $value = null ): bool{

		$value = $value ?? $this->value;

		$isIncluded = is_archive();

		return $this->selectionMode === 'include' ? $isIncluded : ! $isIncluded;
	}
}

```
