Support

Home Forums Event Espresso Premium Proceed to Finalize Registration – change spelling

Proceed to Finalize Registration – change spelling

Posted: February 15, 2015 at 6:19 pm


JackB

February 15, 2015 at 6:19 pm

I was previously using this which worked fine – but no longer works;

// change spelling of finalize register button
function ee_finalize_registration_button() {
 return 'Finalise Registration / Payment';}
add_filter ('FHEE__EED_Single_Page_Checkout__registration_checkout__button_text__finalize_registration', 'ee_finalize_registration_button');

Please advise update.


Josh

  • Support Staff

February 16, 2015 at 9:43 pm

Hi JackB,

I made a ticket for one of the developers to restore that filter. In the meantime I can advise using a translation function like this one:

function jackb_custom_filter_gettext( $translated, $original, $domain ) {
 
    // This is an array of original strings
    // and what they should be replaced with
    $strings = array(
        'Finalize Registration' => 'Finalise Registration / Payment',
        // Add some more strings here
    );
 
    // See if the current string is in the $strings array
    // If so, replace its translation
    if ( isset( $strings[$original] ) ) {
        // This accomplishes the same thing as __()
        // but without running it through the filter again
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
 
    return $translated;
}
 
add_filter( 'gettext', 'jackb_custom_filter_gettext', 10, 3 );

Note where it shows where you can add more strings if you’d like.


Simon

February 17, 2015 at 10:51 am

Hey Josh,

where should I place this function?


Simon

February 17, 2015 at 11:11 am

There is another thing I would like to know:
In add_filter( 'gettext', 'jackb_custom_filter_gettext', 10, 3 );, what does the parameter 10, 3 mean?


Josh

  • Support Staff

February 17, 2015 at 11:21 am

Hi Simon,

We recommend that the code get placed in either:

a) a child theme’s functions.php file
or b) in a custom snippets plugin

the 10 means priority 10, the 3 means there are 3 arguments passed to the function. In this particular use, the 3 arguments are $translated, $original, $domain.

You can refer to the codex article for the add_filter() function for more information and examples that show how add_filter and its parameters work:

http://codex.wordpress.org/Function_Reference/add_filter

The support post ‘Proceed to Finalize Registration – change spelling’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso