WP_HTML_Tag_Processor::change_parsing_namespace()
Switches parsing mode into a new namespace, such as when encountering an SVG tag and entering foreign content.
Метод класса: WP_HTML_Tag_Processor{}
Хуков нет.
Возвращает
true|false
. Whether the namespace was valid and changed.
Использование
$WP_HTML_Tag_Processor = new WP_HTML_Tag_Processor(); $WP_HTML_Tag_Processor->change_parsing_namespace( $new_namespace ): bool;
- $new_namespace(строка) (обязательный)
- One of 'html', 'svg', or 'math' indicating into what namespace the next tokens will be processed.
Список изменений
С версии 6.7.0 | Введена. |
Код WP_HTML_Tag_Processor::change_parsing_namespace() WP HTML Tag Processor::change parsing namespace WP 6.8.1
public function change_parsing_namespace( string $new_namespace ): bool { if ( ! in_array( $new_namespace, array( 'html', 'math', 'svg' ), true ) ) { return false; } $this->parsing_namespace = $new_namespace; return true; }