Home › Forums › General Issues › On every Post Update there is a new meta_id and post_id in the DB
Hi 🙂
It’s not easy to describe it in the Title. After playing around with my first own field i noticed that whenever i save a post the custom field from ACF creates a new meta_id row with the new value AND updates the first one. Is this intended? This will get huge if you got 100+ fields. On every save there will be +100 new post metas.
Ok this is a freshly saved post: (postID: 3595)
http://cl.ly/image/3a34321q1E3F
Now this is how my wp_postmeta looks after i saved the post:
http://cl.ly/image/1h2W0P170n1b
So far so good.
No let’s update the post, screen with values:
http://cl.ly/image/2Q0v0u170Z1s
Now the database:
http://cl.ly/image/1t313N3J0A2V
This gets repeated endless, the original values gets updated (correct) but then they get created new in the db.
Any ideas or is it a bug from the nightly?
(ps: this is not from my own field, i used the standard text and image fields for the test)
Thanks in advance. 🙂
mike
Tested this on a fresh wordpress with ACF from wordpress.org, it’s the same there. 🙁 I hope this is only a bug.
Thanks
Hi @Michael1981
In your first comment you say After playing around with my first own field
. Can you please confirm what you mean by this? Are you creating your own field type?
If so, perhaps the code you are using is creating the extra postmeta.
Thanks
E
Hi Elliot,
thanks for your feedback. 🙂
I just discovered this testing my own field but i can reproduce it on a fresh wordpress 3.8 install with the ACF version from the wordpress repository. (with the standard theme, and nothing from my own fields / code, just everything out of the box, no other plugins).
Tomorrow i will test i online (iam working locally at the moment, Zend Apache) and if i can reproduce it there i will inform you.
Thanks again,
Michael
Hey elliot,
hope everything is good. 🙂
Solved it by remove the standard custom fields from wordpress, looks like they doubled the values by saving them seperatly.
// remove non ACF custom fields
function remove_custom_meta_boxes() {
remove_meta_box('postcustom','post','normal');
remove_meta_box('postcustom','page','normal');
}
add_action('admin_menu','remove_custom_meta_boxes');
Thanks for all your work elliot, most valueable plugin ever. 🙂
The topic ‘On every Post Update there is a new meta_id and post_id in the DB’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.