-
-
Save theeventscalendar/cfb5fda94f5f2a703b34 to your computer and use it in GitHub Desktop.
Auto-publishes events submitted by logged in users
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add to functions.php of your active theme | |
add_filter( 'tribe_events_community_sanitize_submission', 'set_community_events_publication_status' ); | |
function set_community_events_publication_status( $submission ) { | |
// Escape, assuming default is set to 'draft' and 'allow anonymous submits' | |
if ( ! is_user_logged_in() ) return $submission; | |
$submission['post_status'] = 'publish'; | |
return $submission; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment