Created
May 22, 2014 03:11
-
-
Save jazbek/ed37b78ec720bdea1e0f to your computer and use it in GitHub Desktop.
Don't update the event description at eventbrite
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
<?php | |
add_filter('tribe_events_eb_request', 'tribe_dont_send_eb_description', 10, 3); | |
function tribe_dont_send_eb_description( $request, $action, $params ){ | |
// check if we're sending an event update | |
if ( $action == 'event_update' ) { | |
// parse the event data into an array | |
$event_info = array(); | |
parse_str( $params, $event_info ); | |
// unset the event description | |
unset( $event_info['description'] ); | |
// put the new description-less event data back into a string | |
$new_params = _http_build_query( $event_info ); | |
// replace the original event info with the new one before the request is sent to EB | |
$request = str_replace( $params, $new_params, $request ); | |
} | |
return $request; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment