[wp-trac] [WordPress Trac] #61039: Interactivity API: Some property access does not work well in server directives
WordPress Trac
noreply at wordpress.org
Tue Apr 23 14:59:48 UTC 2024
#61039: Interactivity API: Some property access does not work well in server
directives
-------------------------+---------------------
Reporter: jonsurrell | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 6.6
Component: Editor | Version: 6.5
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+---------------------
Comment (by jonsurrell):
> Would it be possible to automatically cast array to object or the other
way
I had an implementation that seemed to work that checked `is_array()` and
used either `$arr[$prop]` or `$obj->$prop` access. It seemed to work well
and I think that should be sufficient.
Another solution would be [https://www.php.net/manual/en/function.get-
object-vars.php get_object_vars()], but I think we'd still have a
conditional check and would be creating full arrays we don't really need.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/61039#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list