-
-
Save Pebblo/6ca533539b2ed37ed88801825fdd2f2f to your computer and use it in GitHub Desktop.
Examples of how to change the ticket selector submit button text from 'Register Now' to 'Purchase Tickets' and also how to change the 'View Details' button to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not include the opening PHP tag if you already have one. | |
function tw_ee_custom_filter_ticket_selector_submit_button_text( $btn_text, $event ) { | |
return __( 'Purchase Tickets', 'event_espresso' ); | |
} | |
add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', 'tw_ee_custom_filter_ticket_selector_submit_button_text', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not include the opening PHP tag if you already have one. | |
//Another example that uses a custom field within the event. | |
//Set a ee_custom_register_text custom field with the string you want to replace the default text with on that event as the value. | |
//If no value has been set default to the standard button text (Register Now). | |
function tw_ee_custom_filter_ticket_selector_submit_button_text( $btn_text, $event ) { | |
$ee_custom_register_text = $event->get_post_meta( 'ee_custom_register_text', true ); | |
if ( $ee_custom_register_text ) { | |
$btn_text = __( 'Custom Register Text Here', 'event_espresso' ); | |
} | |
return $btn_text; | |
} | |
add_filter( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit__btn_text', 'tw_ee_custom_filter_ticket_selector_submit_button_text', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not include the opening PHP tag if you already have one. | |
//Another example that uses a custom field within the event for the 'View Details' text. | |
//Set a ee_custom_view_details_text custom field with the string you want to replace the default text with on that event as the value. | |
//If no value has been set default to the standard button text (Register Now). | |
function tw_ee_custom_filter_ticket_selector_view_details_button_text( $btn_text, $event ) { | |
$ee_custom_register_text = $event->get_post_meta( 'ee_custom_view_details_text', true ); | |
if ( $ee_custom_register_text ) { | |
return $ee_custom_register_text; | |
} | |
return $btn_text; | |
} | |
add_filter( 'FHEE__EE_Ticket_Selector__display_view_details_btn__btn_text', 'tw_ee_custom_filter_ticket_selector_view_details_button_text', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment