Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setup_force_community_author() {
- add_action('save_post', 'force_community_author');
- }
- function force_community_author($postID) {
- // Clear action: this should only run once
- remove_action('save_post', 'force_community_author');
- if (!isset($_POST['community-event'])) return;
- if (!check_admin_referer('ecp_event_submission')) return;
- wp_update_post(array(
- 'ID' => $postID,
- 'post_author' => 2 // Change to the ID of the desired author
- ));
- }
- add_action('tribe_ce_before_event_submission_page', 'setup_force_community_author');
Advertisement
Add Comment
Please, Sign In to add comment