Task: What I'm trying to do
I'm fetching data via the WP Http API from a remote server. The data I'm getting back is
JSON encoded. In one of my methods, I'm converting them back and then push it into a class variable, so I can use it later in some scripts.
Example: How I'm trying to do it
Problem: What's not working
For some reason, I can't access the
json_objectfrom the console (it works for other objects in other classes just fine).
Debug so far
Is it registered and queued?
I tried to take a look if the script is registered:
// 'registered': TRUE var_dump( wp_script_is( 'json_object' ) ); // 'queue': TRUE var_dump( wp_script_is( 'json_object', 'queue' ) );
to be sure, I've also taken a look into the
global $wp_scripts and can confirm, that it's there.
Is it localized?
// Data shows up, JSON encoded var_dump( $GLOBALS['wp_scripts']->registered['json_object']->extra;
Where in core does it stop?
I went into core and backtraced it the following way:
The FIN! notes a call to itself. As you can see from the Link to the WP repo on GitHub, inside
->add_data(), there's another call to
->add_data() (to itself). I dumped the result and got
I'm currently out of "what can I try else?"-options. Maybe someone got an idea, how this is supposed to work or maybe just where I could try to look further.