• I am having an issues with a metabox for a plugin that I am using. The metaboxes aren’t saving on the first publish even though there’s info inside of them. If I hit update then the meta is saved correctly. Not sure if the plugin dev will be fixing this so….

    Does anyone know of a function that I can call so when a post is published for the first time it will then update itself right after to make sure meta saves for the time being?

    Any help would be awesome.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Sitepoint has a decent tutorial which goes through simply creating your own metabox. The important part is the save_post hook at the bottom of the tutorial. Pretty much you need to use the update_post_meta along with the input name attribute.

    What metabox plugins are you using – is it in repo?

    Thread Starter wdrescher

    (@wdrescher)

    I am actually using a theme which uses Piklist for metaboxes. I am using an RSS plugin to input an mp3 in this custom metabox. Everything works but I have to click update every time for the mp3’s to register so the player can be able to preview the audio file.

    The metabox was made buy someone else. I didn’t know if there was a function I can throw in the fucntions.php to hijack the publish job to make every post update after a publish is called. (this would be a temp fix for now as the dev still needs to fix this issue)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Everytime post is published for the first time execute an update’ is closed to new replies.