Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active September 19, 2015 20:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzocaum/38baf9ceb1188185187d to your computer and use it in GitHub Desktop.
Save lorenzocaum/38baf9ceb1188185187d to your computer and use it in GitHub Desktop.
How to change the maximum number of tickets messaging that is shown below the ticket selector in Event Espresso 4

Add the sample code below to your child theme's functions.php file or in a site specific plugin.

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

//* Change the maximum tickets messaging that is shown below the ticket (pricing option)selector
function ee_maximum_tickets_messaging_ticket_selector( $translated, $original, $domain ) {
    $strings = array(
        'Please note that a maximum number of %1$d tickets can be purchased for this event per order.' => 'Please note that there is a maximum number of %1$d tickets that can be reserved for this event per order.',
    );
    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
}
add_filter( 'gettext', 'ee_maximum_tickets_messaging_ticket_selector', 10, 3 );