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

Post Auto Draft Issue

I’ve made custom post type without title and editor and I use custom taxonomies, custom fields and attachments to form a post. My title is generated from custom taxonomies and custom fields (or “ID #” if nothing else is set). Here’s title code (could use some polishing probably): function custom_post_type_title ( $post_id ) { global … Read more

get_terms on save_post hook

Usually, if I want to check for some attribute of the post I’m about to publish, I will check like this: $post_title = $_POST[‘post_title’]; post_title is the name of the title field in the edit window. I thought I’d apply the same logic to the taxonomy meta box. $formats = $_POST[‘tax_input[formats][]’]; Essentially, I’m trying to … Read more