Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Last active May 15, 2020 12:09
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 Pebblo/01368b45b94e43dbb10c69b3b245361c to your computer and use it in GitHub Desktop.
Save Pebblo/01368b45b94e43dbb10c69b3b245361c to your computer and use it in GitHub Desktop.
Example of how to change the Ticket Selector QTY field based on a custom field set on the event
<?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 ee_purchase_tickets to true within your event to display 'Purchase Tickets'
//If no value has been set default to the standard button text (Register Now).
function tw_ee_custom_filter_ticket_selector_qty_text( $qty_text, $event_id ) {
$ee_custom_qty_text = get_post_meta( $event_id, 'ee_custom_qty_text', true );
if ( $ee_custom_qty_text ) {
return $ee_custom_qty_text;
}
return $qty_text;
}
add_filter( 'FHEE__ticket_selector_chart_template__table_header_qty', 'tw_ee_custom_filter_ticket_selector_qty_text', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment