[wp-trac] [WordPress Trac] #61741: Interactivity API: Directives cannot access derived state properties on the server

WordPress Trac noreply at wordpress.org
Wed Jul 24 11:36:20 UTC 2024


#61741: Interactivity API: Directives cannot access derived state properties on the
server
-------------------------------+--------------------
 Reporter:  jonsurrell         |      Owner:  (none)
     Type:  defect (bug)       |     Status:  new
 Priority:  normal             |  Milestone:  6.6.2
Component:  Interactivity API  |    Version:  6.6
 Severity:  normal             |   Keywords:
  Focuses:                     |
-------------------------------+--------------------
 If a directives includes derived state in a non-final position, and this
 is implemented with server-side derived state, this causes an error and
 the directive is not processed correctly. For example:


 {{{
 <p data-wp-text="state.derivedState.property"></p>
 }}}

 Where the state might look something like this:

 {{{#!php
 <?php
 array(
   'derivedState' => function() {
     return array( 'property' => 'Hello, world!' );
   },
 );
 }}}

 This will error and fail to process correctly on the server. On the client
 with derived state getters, this will work fine.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61741>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list