rjvansant
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST API (WP API)] Need to 'prepare_post' datajust posting my response (https://www.ads-software.com/support/topic/a-way-to-utilize-the-json-rest-api-libraries-to-generate-embedded-post-json) to my question here as well, thanks for linking the similar questions @kindom creation
@kingdom creation, sorry i meant to post an update, but i got caught up in meeting a deadline. some of this was due to me still learning the WordPress Way, where i came from a MVC Framework background, but basically you can refer to the global in your function like so:
global $wp_json_posts;
and utilize the get_post() method, passing in post_id, and ‘child’ to indicate recursive lookups or embedding, example below:
$wp_json_posts->get_post( $post_id, ‘child’ );
the one caveat is make sure your method that will use this has access to the children post_ids, which it looks like it does based on your pasted code.
happy coding,
~rob@kingdom creation, sorry i meant to post an update, but i got caught up in meeting a deadline. some of this was due to me still learning the WordPress Way, where i came from a MVC Framework background, but basically you can refer to the global in your function like so:
global $wp_json_posts;
and utilize the get_post() method, passing in post_id, and ‘child’ to indicate recursive lookups or embedding, example below:
$wp_json_posts->get_post( $post_id, ‘child’ );
the one caveat is make sure your method that will use this has access to the children post_ids, which it looks like it does based on your pasted code. i will also post this on your post.
happy coding,
~robForum: Networking WordPress
In reply to: Custom field to wp_nav_menu object@ipstenu thanks for the response, i guess this is due to the database structure with multisites