Yoast\WP\SEO\Routes
SEMrush_Route::has_valid_country_code()
Checks if a valid country code was submitted.
Метод класса: SEMrush_Route{}
Хуков нет.
Возвращает
true|false
. Whether or not the country code is valid.
Использование
$SEMrush_Route = new SEMrush_Route(); $SEMrush_Route->has_valid_country_code( $country_code );
- $country_code(строка) (обязательный)
- The country code to check.
Код SEMrush_Route::has_valid_country_code() SEMrush Route::has valid country code Yoast 24.1
public function has_valid_country_code( $country_code ) { return ( $country_code !== '' && \preg_match( '/^[a-z]{2}$/', $country_code ) === 1 ); }