Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wp_insert_post_data', 'se338236_change_date', 99 );
- function se338236_change_date( $data )
- {
- //
- // uncomment to apply changes only to selected post types
- //$types = [ 'PAGE', 'SOME_CUSTOM_POST_TYPE' ];
- //if ( isset($data['post_type']) && in_array( $data['post_type'], $types ) {
- $data['post_date'] = $data['post_modified'];
- $data['post_date_gmt'] = $data['post_modified_gmt'];
- //}
- return $data;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement