Skip to content

Instantly share code, notes, and snippets.

@barryhughes
Created July 17, 2017 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barryhughes/b7106422425a66b5a3f2fc2556423361 to your computer and use it in GitHub Desktop.
Save barryhughes/b7106422425a66b5a3f2fc2556423361 to your computer and use it in GitHub Desktop.
<?php
add_filter( 'tribe_events_community_sanitize_submission', function( $submission) {
if ( empty( $_POST['tax_input'] ) ) {
return $submission;
}
$submission['tax_input'] = array();
foreach ( $_POST['tax_input'] as $taxonomy => $terms ) {
$taxonomy = filter_var( $taxonomy, FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH );
$submission['tax_input'][ $taxonomy ] = implode( ',', array_map( 'intval', $terms ) );
}
return $submission;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment