Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * This is filters the array of "errors" processed in
- * TribeCommunityEvents::outputMessage().
- *
- * Place this and the matching
- * add_filter() call in your theme functions.php file to quickly replace the
- * "Event submitted" text that is displayed by default when an event is
- * successfully submitted.
- *
- * @param $messages
- * @return array
- */
- function replaceCommunitySubmitThankyou($messages) {
- $messages = (array) $messages;
- $lookFor = 'Event submitted. ';
- $replaceWith = 'You guys rock! '; // Change this to whatever you think appropriate
- foreach ($messages as &$message)
- if (strpos($message['message'], $lookFor) !== false)
- $message['message'] = str_replace($lookFor, $replaceWith, $message['message']);
- return $messages;
- }
- // Filter the "error" messages upon form submission
- add_filter('tribe_community_events_form_errors', 'replaceCommunitySubmitThankyou');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement