Skip to content

Instantly share code, notes, and snippets.

@caseydriscoll
Created August 6, 2014 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save caseydriscoll/7a76948390b12e4a9f75 to your computer and use it in GitHub Desktop.
Save caseydriscoll/7a76948390b12e4a9f75 to your computer and use it in GitHub Desktop.
Tribe: Auto-publish a Community Event only if user is logged in
//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