Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_filter( 'wp_insert_post_data' , 'update_author', '99', 2 );
- function update_author($data , $postarr) {
- if ($postarr['post_status'] == 'draft') {
- $data['post_author'] = 45;
- }
- return $data;
- }
- add_filter( 'wp_insert_post_data' , 'update_author', '99', 2 );
- function update_author($data , $postarr) {
- if ($postarr['post_status'] != 'published') {
- $data['post_author'] = 45;
- }
- return $data;
- }
Add Comment
Please, Sign In to add comment