0

I am currently working on a Wordpress website using Dynamic Featured Image and Twitter Auto Publish plugins.

Both plugins have metaboxes, and I need to ensure that Dynamic Featured Image saves its metaboxes data before Twitter Auto Publish when I am posting/updating a post. However, I cannot find any information about that. Is it even possible to set up a specific order for saving metaboxes datas? How can I do it?

Thanks in advance for your help!

UPDATE #1

After a little more search, I found out that Dynamic Featured Image metaboxes saving is fired when save_post hook is triggered, while Twitter Auto Publish metaboxes saving is fired when transition_post_status hook is triggered. But seems like transition_post_status is fired before save_post though... Still looking for a proper solution which would not require to rewrite the whole function of one of the plugin.

UPDATE #2

Okay, since I did not find a better solution, I removed the action which was set on transition_post_status of Twitter Auto Publish and added a new action on save_post. For this to work, I copied/pasted and rewrote a little bit the function which was fired on transition_post_status, in order to work for save_post.

4

1 回答 1

0

这可能对你有帮助,

save_post 钩子在您保存帖子时触发,因此您也可以安排从帖子屏幕提交的所有帖子数据的顺序。

保存帖子

于 2017-01-04T10:16:50.060 回答