Skip to content

Instantly share code, notes, and snippets.

@caseydriscoll
Created August 6, 2014 15:42
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 caseydriscoll/c958ff287672bc70cd0c to your computer and use it in GitHub Desktop.
Save caseydriscoll/c958ff287672bc70cd0c to your computer and use it in GitHub Desktop.
Tribe: Change Community Events Success Message
// Add to functions.php
add_filter( 'tribe_community_events_form_errors', 'ce_custom_success_message' );
function ce_custom_success_message( $messages ) {
if ( $messages[0]['type'] != 'update' ) return $messages;
$existing_messages = '';
$type = 'update';
if ( is_array( $messages ) ) {
$existing_messages = $messages[0]['message'];
$type = $messages[0]['type'];
}
// Set overall message by appending to the front
$messages[0] = array(
'type' => $type,
'message' => '<h5>Thanks a bunch!</h5>' . $existing_messages
);
// Search/replace text for custom message
$messages[0]['message'] = str_replace( 'Event submitted.', 'You successfully submitted an event. We will contact you soon!', $messages[0]['message'] );
return $messages;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment