This is the necessary Wordpress plugin modification so that the list of custom fields can be pulled from Wordpress via the JSON API.
First you need to add the JSON API plugin to your Wordpress site.
Then go to Plugins -> JSON API -> Edit
Open the json-api/controllers/core.php file and add the following code as the last functions in the class.
function get_acf_fields() { global $json_api; extract($json_api->query->get(array('id', 'slug', 'page_id', 'page_slug', 'children'))); // vars $return = array(); $keys = get_post_custom_keys($id); if($keys) { foreach($keys as $key) { if(strpos($key, 'field_') !== false) { $field = $this->get_acf_field($key, $id); $return[$field['order_no']] = $field; } } ksort($return); } // return fields return $return; } function get_acf_field($field_name, $post_id = false) { $post_id = $post_id ? $post_id : $this->get_post_meta_post_id($field_name); $field = get_post_meta($post_id, $field_name, true); return $field; }
Thanks, it works. I set up the plugin,
ReplyDeleteit only remains to add Google Maps https://elfsight.com/google-maps-widget/, so geolocation is displayed for site visitors, and I think this is pretty well website for the online store will be ready soon. I chose not the most difficult of the Wordpress themes, but the site turned out to be pretty nice thanks to the design, and optimized by carefully selected content, in general, I coped with such task and the customer is satisfied my work actually.
need wordpress templates? visit https://wordpresstemplates.ch/
ReplyDeleteMany people with a WordPress website wonder what to do when they see the notice in the WordPress admin prompting them to upgrade to the latest version.
ReplyDeletehttps://edkentmedia.com/website-design-toronto
Majority each company has their own after sales support center. Customer service is the backbone of any online or offline enterprise. The majority of the companies consider their contracted and temporary workers, their customers as their internal team members, and most.
ReplyDeletehttps://servicecenterguru.com
If you don't know what a content management system is (CMS), it is the ability to manage your own content without the need of editing files. Quite simply, it's the best thing to ever happen to the way we manage our content.etikečių spausdinimas
ReplyDeleteTook me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! wordpress virus remova
ReplyDeleteIf you are looking for more information about flat rate locksmith Las Vegas check that right away. Ozzun Website design and development company
ReplyDeleteThanks for another wonderful post. Where else could anybody get that type of info in such an ideal way of writing? extension opencart
ReplyDeleteMajority each company has their own after sales support center. Customer service is the backbone of any online or offline enterprise. The majority of the companies consider their contracted and temporary workers, their customers as their internal team members, and most. Wordpress webshop laten maken
ReplyDeleteSites we Like…… [...] Every once in a while we choose blogs that we read. Listed below are the latest sites that we choose [...]…… web design new york
ReplyDeleteThank you for the auspicious writeup. It in truth used to be a amusement account it. Glance complex to more added agreeable from you! However, how could we be in contact? website design company nyc
ReplyDeleteI as well believe thence , perfectly pent post! . branding firms san francisco
ReplyDeleteThe writer, through this blog, has earned respect from many for all the right reasonsSpanish
ReplyDeleteThis is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work this website
ReplyDeletehello!! Very interesting discussion glad that I came across such informative post. Keep up the good work friend. Glad to be part of your net community. custom writing service
ReplyDeleteThis blog is really great. The information here will surely be of some help to me. Thanks!. schlüsseldienst
ReplyDelete