- Timestamp:
- 11/03/2026 02:36:41 PM (9 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/interactivity-api/class-wp-interactivity-api.php
r64878 r65228 1154 1154 * JSON encoder, and a value which cannot be sent to the client is rejected rather than passed to 1155 1155 * WP_HTML_Tag_Processor::set_attribute(). 1156 * @since 7.2.0 Event handler bind directives are removed. 1156 1157 * 1157 1158 * @param WP_Interactivity_API_Directives_Processor $p The directives processor instance. … … 1160 1161 private function data_wp_bind_processor( WP_Interactivity_API_Directives_Processor $p, string $mode ): void { 1161 1162 if ( 'enter' === $mode ) { 1162 $entries = $this->get_directive_entries( $p, 'bind' ); 1163 $event_handler_prefix = 'data-wp-bind--on'; 1164 $entries = $this->get_directive_entries( $p, 'bind' ); 1163 1165 foreach ( $entries as $entry ) { 1166 // Binding event handler attributes is not supported. 1167 if ( str_starts_with( $entry['attribute_name'], $event_handler_prefix ) ) { 1168 $p->remove_attribute( $entry['attribute_name'] ); 1169 _doing_it_wrong( 1170 __METHOD__, 1171 sprintf( 1172 /* translators: %s: The directive, e.g. data-wp-on--click. */ 1173 __( 'Binding event handler attributes is not supported. Please use "%s" instead.' ), 1174 esc_attr( 'data-wp-on--' . substr( $entry['attribute_name'], strlen( $event_handler_prefix ) ) ) 1175 ), 1176 '6.9.2' 1177 ); 1178 continue; 1179 } 1180 1164 1181 if ( empty( $entry['suffix'] ) || null !== $entry['unique_id'] ) { 1165 1182 continue; … … 1180 1197 ), 1181 1198 '7.1.4' 1182 );1183 continue;1184 }1185 1186 // Skip if the suffix is an event handler.1187 if ( str_starts_with( $entry['suffix'], 'on' ) ) {1188 _doing_it_wrong(1189 __METHOD__,1190 sprintf(1191 /* translators: %s: The directive, e.g. data-wp-on--click. */1192 __( 'Binding event handler attributes is not supported. Please use "%s" instead.' ),1193 esc_attr( 'data-wp-on--' . substr( $entry['suffix'], 2 ) )1194 ),1195 '6.9.2'1196 1199 ); 1197 1200 continue;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)