[wp-trac] [WordPress Trac] #64518: Interactivity API: `data-wp-bind` stops processing valid directives when encountering an invalid one

WordPress Trac noreply at wordpress.org
Sun Mar 15 06:38:37 UTC 2026


#64518: Interactivity API: `data-wp-bind` stops processing valid directives when
encountering an invalid one
----------------------------------------------------+---------------------
 Reporter:  luisherranz                             |       Owner:  (none)
     Type:  defect (bug)                            |      Status:  new
 Priority:  normal                                  |   Milestone:  7.0
Component:  Interactivity API                       |     Version:
 Severity:  normal                                  |  Resolution:
 Keywords:  has-patch has-unit-tests needs-testing  |     Focuses:
----------------------------------------------------+---------------------

Comment (by alexodiy):

 Reviewed and tested PR [https://github.com/WordPress/wordpress-
 develop/pull/10746 #10746] against trunk r62029, PHP 8.5.1.

 The fix is straightforward: `return` → `continue` on line 1029 in
 `data_wp_bind_processor()`. With `return`, the entire method exits when it
 hits a bind directive with an empty suffix, so any valid `data-wp-bind--
 id` (or similar) on the same element never gets processed. Changing it to
 `continue` skips the bad entry and moves on.

 Worth noting that `data_wp_class_processor()` already handles the same
 case with `continue` (line 1093), so this just brings
 `data_wp_bind_processor()` in line with the existing pattern.

 Tested with a mix of invalid and valid bind directives on the same element
 — valid ones are now processed as expected. No regressions when all
 directives are valid.

 +1 for commit.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/64518#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list