WordPress Post Meta in 10 Minutes | WordPress Metadata and Database Tutorial
Вставка
- Опубліковано 15 гру 2020
- In this video, we go over #WordPress post meta and a few #PHP functions to help us manage it.
WPRocket: wpcasts.tv/go/wprocket
Code: gist.github.com/alexander-you...
💖 Become a Patron to show support & get perks!
/ wpcasts
Sign up for the newsletter. Free course coming soon:
wpcasts.tv
*SOCIAL*
Twitter: / alexanderbyoung
Facebook: / wpcasts.tv - Наука та технологія
I've been looking for a yt channel like yours for so long! Thank you for doing this dude
Next video on user_meta?
Sure thing!
Hey Alex, loving these videos! Something I would really like to see before or after you go into demonstrating how these functions work would be a real-life example of how you used these functions for a client :) Or some common use cases would also be awesome
I liked your video, you touched an area in your instruction that is so simple, but people say it in a complicated way. You kept in the lane of not giving more information that was needed for the understanding of Key and value. Thanks, I needed that piece of information. Appreciate your time in setting up the video.
Man!!! Thank you so much... Loved your video.
AMAZING!!! You explain in a very easy way. Love your content man. Is it possible make a part two but integrate with Custom Post Type? Add, delete and update the post meta from the custom post type page. Thanks man!!!
I'll put it on my list!
@@WPCasts thank you!! 🤘🏻🙂
Thank you soo much for your contribution to the WP community!
Stuff like this allows devs to be free of plugins like ACF for simple jobs :D
Thanks, in 2 minutos of you video, i solve my problem.
Thanks, brother
your code is very useful in my work. And very important this task was completed for me.
Thanks a lot
This video was really useful, thank you so much dude.
Super helpful video!
Valuable info, thanks for sharing 👍😊
Keep up the good works. Very well explained. Subs.
Thank you very much for talking about things so Plugins editors don't say very easily. So they can tax more and more money! Thumb Up For You !
As i have said before this is the best yt channel for advanced wp. What about the online lessons? Still waiting !
very helpful... thanks a lot..
Most welcome!
Thank you for the video. I am using Advanced Custom Fields (ACF) to simplify the process of creating custom fields in WordPress as well as leveraging ACF's ability to layout custom fields in a presentable manner within an editable custom post type. However, I am accessing the content of a custom post with WordPress' get_post_custom function instead of ACF's get_field function. I read about this elsewhere (the source escapes me), and this approach provides value in the event someone deactivates the ACF plugin.
While playing around with ACF's "group" and "tab" field types in order to design a more user-friendly custom field layout in the post editor's screen, I discovered a problem. Namely, I used the same field names when deleting ACF fields and replacing them within alternative ACF "group" and "tab" contexts. For example, I originally may have had a "About" group with three tabs and each tab having a few fields/sub-fields. Suppose one such field was assigned the ACF field name "product_container". In trying alternate layout designs, I may have created another ACF group (e.g., "Details"), deleted the original "product_container" ACF field within the "About" ACF group and then recreated the "product_container" field within the "Details" ACF group. Unfortunately, when I deleted the original 'product_container' ACF field, its corresponding entry in the WordPress MySQL "post meta" table was retained, which I find to be a strange (default) ACF behavior. Frankly, I do not see any value in retaining a "post meta" record when its correlated ACF custom field is purged.
Unfortunately, this causes a problem, as the custom post now displays the wrong "product_container" metadata value. I realize ACF has functions analogous to the ones you present in this video. In fact, my guess is these ACF functions wrap the PHP functions you presented here. However, as noted earlier, I am deliberately avoiding the ACF functions in the event someone deactivates the ACF plugin.
Can you provide some guidance on how best to leverage the PHP functions within the context of meta data created by the ACF plugin? I realize it will require identifying the IDs for the various post meta records generated by ACF, but I wonder if I need to make any changes within the "posts" table, also, in order to avoid the occurrence of orphaned records. The nature of the database relationships becomes further complicated on account of its denormalization. For example, consider this "meta value" value for "product_container": "a:1:{i:0;s:3:"rea";}". This format makes it difficult to trace the meaning of "a", "i" and "s", and, given the value is of type string (as confirmed by the PHP "gettype" function), I need to use a string search/extraction function simply to retrieve the "rea" portion of this string value. It's a clunky design, and, somewhere down the road, I'll need to dive into WP's database API, so that I can design my own tables to my liking.
very nice
nice "Bengkel Kaki Mobil Purwokerto"
Thanks for this lesson. What about query postmeta by slug instead id ? There are situations where need postmeta from different posts.
Great presentation man. Inspiring. What text editor is that? I couldn't tell. Thought maybe Sublime, but not sure because I am not experienced enough with it or PHP to have recognized it. Either way, 🎅🏻🎄 Merry Christmas and a 🥳🥂 Happy New Year to your and your family sir. ✌🏻
very nice. what extensions you used for integrating wordpress in to Vscode?
CoOl ViD..! 👍
Hey buddy, wonderfull tutorial, I was wondering that maybe is also usefull if you have the information about a wp method to get all meta for a particular post. Does that even exist?? Thanks in advance
How can we handle a lot of metadata in WordPress? Say, for a library of photos that need to meet either METS or Dublin Core metadata standards?
Hey Alex, Can you create a video about how to get a freelance project or a remove job as a wordpress developer?
Please make a video on shortcode advanced
hey Alex, can u share with us your VS Code setup for Wordpress ? =) Tnx
Please create video on form submition from frontens
Can you please make a tutorial on how to extend the wordpress metadata api for creating custom table. Please, as soon as possible...please
First 😛
Hey guys,somehow,when I use add post meta function, it adds multiple same post metas with same meta values in the wp_postmeta table. I don't know why,cant't google the answer.It should be only one meta key with one meta id and meta value
I guess you need to use update_post_meta instead of add_post_meta
What