Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active February 12, 2016 02:59
Show Gist options
  • Save lorenzocaum/82523b3d032879b58e6c to your computer and use it in GitHub Desktop.
Save lorenzocaum/82523b3d032879b58e6c to your computer and use it in GitHub Desktop.
How to change the sold out messaging that is shown in Event Espresso 4

Add the sample code below to your child theme's functions.php file or in a site specific plugin. Then change REPLACE ME to the new messaging that you would like to display to your attendees/registrants.

<?php
//* Do NOT include the opening php tag

//* Change sold out messaging in Event Espresso 4
function ee_custom_sold_out_messaging( $translated, $original, $domain ) {
    $strings = array(
        'We\'re sorry, but all ticket sales have ended.' => 'REPLACE ME',
    );
    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
}
add_filter( 'gettext', 'ee_custom_sold_out_messaging', 10, 3 );
@lorenzocaum
Copy link
Author

References:

Check out more tutorials for Event Espresso

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment