Advertisement
Guest User

Untitled

a guest
Aug 24th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.63 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin Name: Site plugin for clairescreativeadventures.com
  4. Description: Site specific code for clairescreativeadventures.com
  5. */
  6. /* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
  7. function ee_proceed_to_button( $submit_button_text, EE_Checkout $checkout ) {
  8.  if ( ! $checkout instanceof EE_Checkout || ! $checkout->current_step instanceof EE_SPCO_Reg_Step || ! $checkout->next_step instanceof EE_SPCO_Reg_Step ) {
  9.   return $submit_button_text;
  10.  }
  11.  if ( $checkout->next_step->slug() == 'payment_options' ) {
  12.   $submit_button_text = 'Finalize Pre-Registration';
  13.  }
  14.  return $submit_button_text;
  15. }
  16.  
  17. add_filter ( 'FHEE__EE_SPCO_Reg_Step__set_submit_button_text___submit_button_text', 'ee_proceed_to_button', 10, 2 );
  18.  
  19. function ee_register_now_button() {
  20.  return 'Pre-Register';
  21. }
  22.  
  23. add_filter ('FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', 'ee_register_now_button');
  24.  
  25. function tw_custom_filter_gettext( $translated, $original, $domain ) {
  26.  
  27.     // This is an array of original strings
  28.     // and what they should be replaced with
  29.     $strings = array(
  30.         'Ticket Options' => 'Registering For',
  31.     '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',
  32.     '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',
  33.     // Add some more strings here
  34.     );
  35.  
  36.     // See if the current string is in the $strings array
  37.     // If so, replace its translation
  38.     if ( isset( $strings[$original] ) ) {
  39.         // This accomplishes the same thing as __()
  40.         // but without running it through the filter again
  41.         $translations = get_translations_for_domain( $domain );
  42.         $translated = $translations->translate( $strings[$original] );
  43.     }
  44.  
  45.     return $translated;
  46. }
  47.  
  48. add_filter( 'gettext', 'tw_custom_filter_gettext', 10, 3 );
  49.  
  50. /* Stop Adding Functions */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement