Yoast\WP\SEO\Actions\Wincher

Wincher_Keyphrases_Action::would_exceed_limits()protectedYoast 1.0

Determines whether the amount of keyphrases would mean the user exceeds their account limits.

Метод класса: Wincher_Keyphrases_Action{}

Хуков нет.

Возвращает

true|false. Whether the limit is exceeded.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->would_exceed_limits( $keyphrases, $limits );
$keyphrases(строка|массив) (обязательный)
The keyphrases to be added.
$limits(объект) (обязательный)
The current account limits.

Код Wincher_Keyphrases_Action::would_exceed_limits() Yoast 22.3

protected function would_exceed_limits( $keyphrases, $limits ) {
	if ( ! \is_array( $keyphrases ) ) {
		$keyphrases = [ $keyphrases ];
	}

	if ( \is_null( $limits->limit ) ) {
		return false;
	}

	return ( \count( $keyphrases ) + $limits->usage ) > $limits->limit;
}