Skip to content

Instantly share code, notes, and snippets.

@joemang1969
Created August 31, 2016 04:29
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/3f5b159e1962d903af064965e9456253 to your computer and use it in GitHub Desktop.
Save joemang1969/3f5b159e1962d903af064965e9456253 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 through Paypal or instructions to pay with check by mail.',
'%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 email with a payment link, or a response to your inquiry!',
// 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