Changeset 61197
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
r61020 r61197 521 521 } 522 522 } else { 523 if ( 0 !== count( $p->get_attribute_names_with_prefix( 'data-wp-each-child' ) ) ) { 523 $each_child_attrs = $p->get_attribute_names_with_prefix( 'data-wp-each-child' ); 524 if ( null === $each_child_attrs ) { 525 continue; 526 } 527 528 if ( 0 !== count( $each_child_attrs ) ) { 524 529 /* 525 530 * If the tag has a `data-wp-each-child` directive, jump to its closer -
trunk/tests/phpunit/tests/interactivity-api/wpInteractivityAPI.php
r61020 r61197 1258 1258 1259 1259 /** 1260 * Tests that the `process_directives` handles self-closing BR tags without 1261 * causing fatal errors and processes directives correctly. 1262 * 1263 * @ticket 63891 1264 * @covers ::process_directives 1265 */ 1266 public function test_process_directives_handles_br_self_closing_tags_with_invalid_closers() { 1267 $this->interactivity->state( 1268 'myPlugin', 1269 array( 1270 'id' => 'some-id', 1271 ) 1272 ); 1273 1274 $html = '</br><div data-wp-bind--id="myPlugin::state.id">Content</div>'; 1275 1276 $processed_html = $this->interactivity->process_directives( $html ); 1277 1278 $p = new WP_HTML_Tag_Processor( $processed_html ); 1279 $p->next_tag( 'div' ); 1280 1281 $this->assertSame( 'some-id', $p->get_attribute( 'id' ) ); 1282 } 1283 1284 /** 1260 1285 * Tests that the `process_directives` process the HTML outside a SVG tag. 1261 1286 *
Note: See TracChangeset for help on using the changeset viewer.