rest api add post meta

You’ll want to use the field and the post type. You’ll add the following to your functions.php add_action( ‘rest_api_init’, function () { register_rest_field( ‘<post-type>’, ‘folder_path’, array( ‘get_callback’ => function( $post_arr ) { return get_post_meta( $post_arr[‘id’], ‘folder_path’, true ); }, ) ); register_rest_field( ‘<post-type>’, ‘file_name’, array( ‘get_callback’ => function( $post_arr ) { return get_post_meta( $post_arr[‘id’], ‘file_name’, … Read more

Get featured image and additional posts thumbnail WordPress REST API

(function($){ $(document).ready(function(){ var items = []; $.getJSON(‘https://localhost/wordpress/wp-json/wp/v2/posts?category_name=portfolio&per_page=50&_embed’, function(response){ console.log(response); $.each(response, function(key,val){ //console.log(val._embedded[‘wp:featuredmedia’][0].source_url); items.push(”+”+ ”); }); }); }); }(jQuery)); //use variable array to push data

Extract XML/JSON element from Zillow API response and populate into Gravity Forms field

the first step is to extract the value with this kind of code, does it work for you ? $xml = simplexml_load_string($result); $value = (string) $xml->response->results->result->zestimate->amount; var_export($value, FALSE); the next step is to put the value in the form. the Gravity Form is not free then we cannot test it and I only find that … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)