Created
August 6, 2014 18:22
-
-
Save caseydriscoll/7a76948390b12e4a9f75 to your computer and use it in GitHub Desktop.
Tribe: Auto-publish a Community Event only if user is logged in
This file contains 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