Created
July 17, 2017 20:16
-
-
Save barryhughes/b7106422425a66b5a3f2fc2556423361 to your computer and use it in GitHub Desktop.
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
<?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