How to get a post meta value and pass that to update_option when a post is created or updated?
How to get a post meta value and pass that to update_option when a post is created or updated?
How to get a post meta value and pass that to update_option when a post is created or updated?
The problem was permissions to Administrator and Editor of editing HTML. In multisite those permissions are gone – so I’ve installed Unfilterd MU plugin and its solved.
This can happen as you said there are some errors in code or if there is long or duplicate queries. Try to debug it with Query Monitor. Same reason if Safe button takes longer to get active.
Access NEW/UPDATED post values in save_post() callback function
You can check the request value, before save and get an hint via wp_die() add_action( ‘save_post’,’wpse46583_save’, 10, 2 ); function wpse46583_save( $post_id, $post ) { // verify this is not an auto save routine. if ( defined(‘DOING_AUTOSAVE’) && DOING_AUTOSAVE ) return; // You should check nonces and permissions here if ( ! current_user_can( ‘edit_page’, $post_id … Read more
The answer appears to be clear if you look at the source code. The action you’re hooking to occurs inside wp_insert_post, and is called just before it returns the $post_ID variable. This means that all the manipulation and data insertion has already taken place, so modifying the $_POST array will do nothing. You must look … Read more
After some searching and working off of some pointers from toscho, and some other helpful posts to avoid an infinite loop I managed to figure out a solution. I’ll post the code below then briefly explain: // Hook into the actions here public function __construct() { add_action( ‘add_meta_boxes’, array($this, ‘meta_boxes’ )); add_action( ‘save_post’, array($this, ‘save_bio_data’ … Read more
Check if ( defined( ‘DOING_CRON’ ) && DOING_CRON ), which will be true if the post save is triggered during a scheduled cron job.
You might not have all the right actions covered, try to add those: add_action(‘new_to_pending’, ‘notify_email_rejected’); add_action(‘auto-draft_to_pending’, ‘notify_email_rejected’);
In my experience this happens when you initiate an operation (Save/Update) and then try to leave the page to do something else before the requested operation has completed. Next time you save/update a post wait until the edit page returns to normal and displays your content. Then navigate away from the edit page. Chances are … Read more