The best Vue.js WordPress REST Course on KZbin a have seen so far . Thanks a lot for sharing you knowledge!
@MarinStoyanov4 жыл бұрын
Thank you for the good explanation. The implementation of adding custom fields to the WP REST API still works in 2020.
@WatchandLearnTutorials4 жыл бұрын
Good to know. Thanks ;)
@Allensph5 жыл бұрын
For anyone who Interests: Toolset Type do not offically support REST API on it's custom fields yet. But I found a plugin called "WP REST API Controller" is able to active Custom Fields built with Toolset Type, and it provide custom meta key to rename default like 'wpcf-...' It works like a charm for me.
@ashkanahmadi3 жыл бұрын
Excellent thanks. This method still works in 2021. Is there a newer more updated method of doing this?
@WatchandLearnTutorials3 жыл бұрын
Yeah, there are new methods of doing this. Vue is now in version 3.0 I think, also there is something called Nuxt.js (Vue framework) which is way better for doing this since it has server side rendering, and with it you will get much better SEO. I have a series about Nuxt and WP: kzbin.info/aero/PLUBR53Dw-Ef9JLwJaZilBFRn03QoC8ZCT but that may be a bit outdated also. You can also check out this series: kzbin.info/aero/PLUBR53Dw-Ef_oTLzPB3G5CdLWnGOSsec3 but this uses Next.js which is a React framework very similar to Nuxt.js and Strapi is used as CMS/API. But the general idea is the same, so you can take a look at that to get the main concepts.
@xanderseren27268 жыл бұрын
I am using toolset for custom fields and have a 'date' field that allows for multiple dates to be added (this is an option when setting a date field in toolset). When I use this method to grab the date field only the first date is pushed through to the rest api. Any insight on how I would grab the multiple dates if more than one is added? These videos have been super helpful. Thank you!
@Genuus14 жыл бұрын
Works great! But how about images? When I outputs custom field in this way - I'm getting just a number insead of image
@Genuus14 жыл бұрын
actually it's ok with images. But how to add more than one field?
@martynasb7 жыл бұрын
Hey, you are doing great job making video tutorials. One issue about custom fields: how you deal with the occasion, when you need a custom field not for EVERY post of your particular post type but, for instance, some settings fields for ALL posts of that type? Probably, I would use Option Tree plugin, but I think it would be better to extend post type with "Settings" (under "All items", "Add new" in that menu, for example). In that page there would be some fields which could be used (printed) in theme files. So I would suggest to make some kind of tutorial, dealing with this situation. Or maybe there are other solutions, which you prefer.
@ivan7477 жыл бұрын
I deal with it with Option Tree Plugin :) ... sometimes with ACF options plugin, which does the same thing just inside the ACF framework. I don't think there is a need for doing this some special way. Because Option tree and ACF a really great plugins, so no need to make your own solution for that IMO.
@kasramy88456 жыл бұрын
Thank you very much bro for the nice useful tutorial. Could you please let us know how can we add a Repeater Custom Feld to the api as well?
@WatchandLearnTutorials6 жыл бұрын
This tutorial is more than two years old, and I don't do much of WP development anymore. So honestly I don't know. You can maybe ask on Stack Overflow or ACF forums how to register repeater fields to the API.
@mohammadumar4435 жыл бұрын
if we want to add more than one custom field of ACF then what would be the way?
@WatchandLearnTutorials5 жыл бұрын
The same way you register one field :) ... but if you wan't to have less code, you can try something like this: github.com/WP-API/WP-API/issues/2137 - so putting your register_rest_field function in foreach loop.
@mohammadumar4435 жыл бұрын
@@WatchandLearnTutorials thanks for your reply. it's awesome. but it adds key of custom field not value. How can i get value in jquery or ajax using that key? second i am not able to get value of relation custom field in function.php can you please help me out. it will be huge favour.?
@mohammadumar4435 жыл бұрын
@@WatchandLearnTutorials @Watch and Learn thanks for your reply. it's awesome. but it adds key of custom field not value. How can i get value in jquery or ajax using that key? second i am not able to get value of relation advance custom fields in functions.php. I searchd internat but not finding any solution please help me out in this also
@WatchandLearnTutorials5 жыл бұрын
@@mohammadumar443 Sorry man, as you can see this video is almost 3 years old, and I haven't touch WP Rest for almost all that time. So I don't remember most of it. Maybe better ask at Stack Overflow, or WordPress forums.
@mohammadumar4435 жыл бұрын
no problem. I solved the issue with another foreach loop inside an wp query loop... is it ok to have another loop in loop,?thanks for ur help
@androidapps29055 жыл бұрын
How can I do same thing for product extra field woocommerce?