Yoast\WP\SEO\Conditionals

Wincher_Token_Conditional{}Yoast 1.0

Conditional that is only met when the Wincher token is set.

Хуков нет.

Использование

$Wincher_Token_Conditional = new Wincher_Token_Conditional();
// use class methods

Методы

  1. public __construct( Wincher_Client $client )
  2. public is_met()

Код Wincher_Token_Conditional{} Yoast 22.4

class Wincher_Token_Conditional implements Conditional {

	/**
	 * The Wincher client.
	 *
	 * @var Wincher_Client
	 */
	private $client;

	/**
	 * Wincher_Token_Conditional constructor.
	 *
	 * @param Wincher_Client $client The Wincher client.
	 */
	public function __construct( Wincher_Client $client ) {
		$this->client = $client;
	}

	/**
	 * Returns whether this conditional is met.
	 *
	 * @return bool Whether the conditional is met.
	 */
	public function is_met() {
		return $this->client->has_valid_tokens();
	}
}