WP_Interactivity_API_Directives_Processor::skip_to_tag_closer()
Skips processing the content between tags.
It positions the cursor in the closer tag of the foreign element, if it exists.
This function is intended to skip processing SVG and MathML inner content instead of bailing out the whole processing.
Метод класса: WP_Interactivity_API_Directives_Processor{}
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
true|false
. Whether the foreign content was successfully skipped.
Использование
$WP_Interactivity_API_Directives_Processor = new WP_Interactivity_API_Directives_Processor(); $WP_Interactivity_API_Directives_Processor->skip_to_tag_closer(): bool;
Список изменений
С версии 6.5.0 | Введена. |
Код WP_Interactivity_API_Directives_Processor::skip_to_tag_closer() WP Interactivity API Directives Processor::skip to tag closer WP 6.7.1
public function skip_to_tag_closer(): bool { $depth = 1; $tag_name = $this->get_tag(); while ( $depth > 0 && $this->next_tag( array( 'tag_closers' => 'visit' ) ) ) { if ( ! $this->is_tag_closer() && $this->get_attribute_names_with_prefix( 'data-wp-' ) ) { /* translators: 1: SVG or MATH HTML tag. */ $message = sprintf( __( 'Interactivity directives were detected inside an incompatible %1$s tag. These directives will be ignored in the server side render.' ), $tag_name ); _doing_it_wrong( __METHOD__, $message, '6.6.0' ); } if ( $this->get_tag() === $tag_name ) { if ( $this->has_self_closing_flag() ) { continue; } $depth += $this->is_tag_closer() ? -1 : 1; } } return 0 === $depth; }