Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to change the add to event cart button label 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

//* Adjust the add to event cart button text
function ee_custom_messaging_add_to_event_cart( $translated, $original, $domain ) {
    $strings = array(
        'Add to %s' => 'Register Now',
    );
    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
}
add_filter( 'gettext', 'ee_custom_messaging_add_to_event_cart', 10, 3 );
@lorenzocaum

This comment has been minimized.

Copy link
Owner Author

lorenzocaum commented Oct 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.