wp_insert_post_data filter not working correctly after upgrade to WordPress 5
I have the following code in a project. function vb_post_modified_date_update($data, $postarr) { if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; if (!empty($postarr[‘vb_modified_date_switch’])) { $data[‘post_modified’] = $postarr[‘post_modified’]; $data[‘post_modified_gmt’] = $postarr[‘post_modified_gmt’]; } return $data; } add_filter( ‘wp_insert_post_data’, ‘vb_post_modified_date_update’, ’99’, 2 ); What this used to do (it worked before upgrading to WordPress 5), is to keep … Read more