Yoast\WP\SEO\MyYoast_Client\Domain
Discovery_Document::is_non_empty_string_array
Checks whether a value is a non-empty array containing only strings.
phpcs:disable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint -- Validation method, accepts any type for checking.
Метод класса: Discovery_Document{}
Хуков нет.
Возвращает
true|false. True if the value is a non-empty array of strings.
Использование
$result = Discovery_Document::is_non_empty_string_array( $value ): bool;
- $value(разное) (обязательный)
- The value to check.
phpcs:enable SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint.DisallowedMixedTypeHint.
Код Discovery_Document::is_non_empty_string_array() Discovery Document::is non empty string array Yoast 28.3
private static function is_non_empty_string_array( $value ): bool {
if ( ! \is_array( $value ) || $value === [] ) {
return false;
}
foreach ( $value as $item ) {
if ( ! \is_string( $item ) ) {
return false;
}
}
return true;
}