Skip to content

Instantly share code, notes, and snippets.

@joemang1969
Created August 29, 2016 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemang1969/a9734ca64ca3470b626038333cc81a43 to your computer and use it in GitHub Desktop.
Save joemang1969/a9734ca64ca3470b626038333cc81a43 to your computer and use it in GitHub Desktop.
<?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',
'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.'=> '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:
Claires 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.',
// 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 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment