- Timestamp:
- 03/24/2025 02:51:19 PM (8 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
r59477 r60070 452 452 // Checks if there is a server directive processor registered for each directive. 453 453 foreach ( $p->get_attribute_names_with_prefix( 'data-wp-' ) as $attribute_name ) { 454 if ( ! preg_match( 455 /* 456 * This must align with the client-side regex used by the interactivity API. 457 * @see https://github.com/WordPress/gutenberg/blob/ca616014255efbb61f34c10917d52a2d86c1c660/packages/interactivity/src/vdom.ts#L20-L32 458 */ 459 '/' . 460 '^data-wp-' . 461 // Match alphanumeric characters including hyphen-separated 462 // segments. It excludes underscore intentionally to prevent confusion. 463 // E.g., "custom-directive". 464 '([a-z0-9]+(?:-[a-z0-9]+)*)' . 465 // (Optional) Match '--' followed by any alphanumeric charachters. It 466 // excludes underscore intentionally to prevent confusion, but it can 467 // contain multiple hyphens. E.g., "--custom-prefix--with-more-info". 468 '(?:--([a-z0-9_-]+))?$' . 469 '/i', 470 $attribute_name 471 ) ) { 472 continue; 473 } 454 474 list( $directive_prefix ) = $this->extract_prefix_and_suffix( $attribute_name ); 455 475 if ( array_key_exists( $directive_prefix, self::$directive_processors ) ) {
Note: See TracChangeset
for help on using the changeset viewer.