return content section as json in wp rest api v1

You can (and you should) always filter the output of WP_REST_API. add_filter(‘json_prepare_post’, ‘change_this_into_a_proper_function_name’, 999); function change_this_into_a_proper_function_name($post){ // hack and slash into your $post here. This is a regular WP_Post // add custom fields and tax terms you might need, remove what // you don’t want to expose to app or are never going to need… … Read more

Dynamic data table from external json feed

For the first question you could try with the following gist in the github https://gist.github.com/phpkidindia/a448e9b8132d3634bdebfa70a8d20c03 For the second option you should create a form with two fields date and distance and on the change event of those two fields you should create ajax request. and bind the result to the data table. Hope this helps.

adding two json fields to post_content

this is the solution: ‘post_content’ => $product_data[‘note’] . ‘<br>’. $product_data[‘note2′], this concatenates strings ‘note’ and ‘note2’. Thanks for the hints.

I can’t get those posts from the wordpress to ionic

The API endpoint for the post type ‘accomodation’ is /wp-json/wp/v2/posts?type=accomodation Custom Post Types however are not shown in the API by default. You can enable this per Post Type by adding show_in_rest’ => true, to the register_post_type arguments. Documentation can be found here

Get the name of the post type

My sleuthing methods go like this: Look for an XML sitemap. If the site uses a common plugin like Yoast SEO and generates sitemaps, often the URLs will give you enough clues to figure out what the post types are named. Unfortunately, it doesn’t appear this site is using any XML sitemap plugins. Look for … Read more

How can cookie/session authentication be used in wp-json fetch request?

After reading more, thanks to Jacob’s link and more googling, it turns out that wordpress “nonces” aren’t actually nonces. Nonces are to be used once, but wordpress “nonces” are allowed to be used an unlimited number of times for 2 “ticks”, which normally means between 12 and 24 hours. These wordpress “nonces” are actually tied … Read more

Add custom schema to post

I’ve used a custom field and added the data above which works well but isn’t user friendly. Use Custom Post Types and add Meta Boxes to make it user friendly. Here’s a basic example of adding a custom post type: function create_post_type() { register_post_type( ‘car’, array( ‘labels’ => array( ‘name’ => __( ‘Cars’ ), ‘singular_name’ … Read more