Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active September 19, 2015 20:03
Show Gist options
  • Save lorenzocaum/b85b1fdfaba8ab7c9f8e to your computer and use it in GitHub Desktop.
Save lorenzocaum/b85b1fdfaba8ab7c9f8e to your computer and use it in GitHub Desktop.
Change the button text for the Register Now button on the Event Espresso calendar

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
 
//* Replace the Register Now text with something else
function ee_change_register_now_button_calendar( $translated, $original, $domain ) {
 
    $strings = array(
        'Register' => 'Sign up',
    );

    if ( isset( $strings[$original] ) ) {
        $translations = &get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'ee_change_register_now_button_calendar', 10, 3 );
@lorenzocaum
Copy link
Author

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