WP_Speculation_Rules::is_valid_id
Checks whether the given ID is valid.
Метод класса: WP_Speculation_Rules{}
Хуков нет.
Возвращает
bool. True if the ID is valid, false otherwise.
Использование
// private - только в коде основоного (родительского) класса $result = $this->is_valid_id( $id ): bool;
- $id(строка) (обязательный)
- Unique string identifier for the speculation rule.
Список изменений
| С версии 6.8.0 | Введена. |
Код WP_Speculation_Rules::is_valid_id() WP Speculation Rules::is valid id WP 7.1.4
private function is_valid_id( string $id ): bool {
return (bool) preg_match( '/^[a-z][a-z0-9_-]+$/', $id );
}