<?php
/*
Plugin Name: Site plugin for clairescreativeadventures.com
Description: Site specific code for clairescreativeadventures.com
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
function ee_proceed_to_button( $submit_button_text, EE_Checkout $checkout ) {
if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
return $submit_button_text;
}
if ( $checkout->next_step->slug() == 'payment_options' ) {
$submit_button_text = 'Finalize Pre-Registration';
}
return $submit_button_text;
}
add_filter ( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_proceed_to_button', 10, 2 );
function ee_register_now_button() {
return 'Pre-Register';
}
add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', 'ee_register_now_button');
function tw_custom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'Ticket Options' => 'Registering For',
'The following events do not require payment at this time and will not be billed during this transaction. Billing will only occur after the attendee has been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.'=> 'The following event must be pre-approved to register. You will be notified when your registration has been processed. You will receive an invoice via email, or a response to your inquiry! PLEASE CLICK TO FINALIZE REGISTRATION',
// 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', 'tw_custom_filter_gettext', 10, 3 );
/* Stop Adding Functions */
‘%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.’ => ‘The following event must be pre-approved to register. You will be notified when your registration has been processed. You will receive an invoice via email, or a response to your inquiry!’,
and it worked, then i edited and it failed??
‘The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.’=> ‘test’,
is another string I would like to use
not sure what happened but please help if you can??
‘The following Event(s) you have registered for do not require payment at this time and will not be billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.’=> ‘test’,
This section you see it says “test”
I’m trying this
‘Thank you for your interest! Please check your email within 24-48hrs for your online payment link.
If you prefer to mail a check to avoid CC fees, please send your check postmarked before 9/9/2016 to:
Claire’s Creative Adventures
10-38 47th Rd, Suite 6
Long Island City, NY 11101
(spaces filled in order in which payment is received.)
If paying by check, please do let us know, so that we may look for it while your registration is pending.’,
as a substitute for “test”
but it causes error on line 34??
is it too long? the above text is what I want on thank you page
It’s the apostrophe within Claire's, you need to either escape the apostrophe using a backslash, so Clairs\'s or switch the string to be wrapped in "..." rather than '...'
PHP thinks that apostrophe is the end of the string.
Your registration has been successfully processed.Check your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.’ => ‘The following event must be pre-approved to register. You will be notified when your registration has been processed. You will receive an invoice via email, or a response to your inquiry!’,
A gettext filter needs an exact match including any spacing to work.
After making the changes above, could you upload your current site specific plugin to a service like Dropbox or Gist (https://gist.github.com) so we can take a look?
Thanks and so we understand the current issue. The original one that you shared works but when you add the new entry then it does not?
The newest entry has some single quotes that are formatted. I referred to them as apostrophes earlier but I meant single quotes. Try removing those by deleting and then typing in a single quote from your keyboard.
The support post ‘changing thank you text’ 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.
Support forum for Event Espresso 3 and Event Espresso 4.