0

Does anyone know of an easy way to be able to edit ALL of a single post's meta at once ie on the post.php &action=edit page?

As some of the meta has been put in there with the update_post_meta() and isn't consistent between posts it would be really helpful to have a way of just editing ANY meta value from the post's edit page?

Have been scouring around for anything, code / plugins and can't see it mentioned much but thought it must be a common enough problem?

I've attached an image of my imagined solution from a meta inspector edited through the browser inspector just in case it isn't clear what I'm asking

Screenshot

  • So does every post have the same set of meta keys & values? If so I would just do an update query in phpMyAdmin or something similar.. – Nathan Fitzgerald - Fitzgenius Jan 20 '15 at 12:56
  • Unfortunately there are different keys and values for most of the pages depending on what the update_post_meta is storing. Otherwise I could simply register another meta box and use that to edit each. - Also I should mention I only want to change one individual post at a time. – Bysander Jan 20 '15 at 13:00
  • Can you provide any criteria regarding which fields you are trying to edit/change? I assume you don't want check_in, event, event_date, and member to be completely identical, yes? Please describe what you are trying to do a bit more clearly. – GhostToast Jan 20 '15 at 14:43
  • I'd like to be able to edit EVERY piece of meta, at my leisure on an individual post basis. Each post has different Keys and data that would be v labour intensive to register and create meta boxes for each one. The image was just used as an example. – Bysander Jan 20 '15 at 15:05
  • I'm not sure I understand the issue. you'd only need a single meta box that outputs all the meta via get_post_custom. – Milo Jan 20 '15 at 20:14
0

So awkwardly realised I'd been going about this whole thing in a stupid roundabout way and in fact Milo above in the comments is completely right, and proves that the codex still has secrets for everyone, or maybe just me.

The eureka (or durr-eka) moment came after reading this post here about setting up and editing the content of the metaboxes.

Instead of calling the individual meta to be edited using get_post_meta I used the get_post_custom() and simply cycled through every post meta entry using a foreach loop and a simple isset form for each generated.

Apologies for the obvious question but thought I'd answer it myself rather than delete it in case anyone else out there is doing it wrong too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.