Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Tony Warwick Pebblo

🏠
Working from home
  • Event Espresso
  • Liverpool, UK
Block or report user

Report or block Pebblo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Pebblo
Pebblo / example.php
Created Aug 19, 2019
How to change the 'No payments towards this transaction have been received.' on the thank you page
View example.php
<?php // Please do not include the opening PHP tag if you already have one
// Change the 'No payments towards this transaction have been received.' text shown on the thank you page.
add_filter( 'FHEE__payment_overview_template__no_payments_made', 'tw_ee_no_payments_made_text' );
function tw_ee_no_payments_made_text() {
return 'Your custom text here';
}
@Pebblo
Pebblo / tw_ee_check_all_checkboxes_for_primary_question_groups_on_create.php
Last active Aug 1, 2019
An example of how you can use jQuery to check all of EE's "Primary Registrant" questions groups when creating a new event. #EE #eventeditor #jquery
View tw_ee_check_all_checkboxes_for_primary_question_groups_on_create.php
<?php //Please do not include the opening PHP tag if you already have one
add_action(
'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__create_new',
'tw_ee_check_all_checkboxes_for_primary_question_groups_on_create'
);
function tw_ee_check_all_checkboxes_for_primary_question_groups_on_create() {
add_action(
'AHEE_event_editor_questions_notice',
'tw_ee_custom_checkboxes_for_primary_question_groups'
@Pebblo
Pebblo / tw_ee_filter_powered_by_event_espresso.php
Last active Aug 1, 2019
Example of how to change the EE admin foot text to include details from other plugins. #EE #admin_general
View tw_ee_filter_powered_by_event_espresso.php
<?php //Please do not include the opening PHP tag if you already have one.
//Remove the EE espresso_admin_footer callback and add another which includes current content.
add_action('admin_init', 'tw_filter_admin_footer_text');
function tw_filter_admin_footer_text() {
$admin = EE_Registry::instance()->load_core('EE_Admin');
remove_filter('admin_footer_text', array($admin, 'espresso_admin_footer'));
add_filter('admin_footer_text', 'tw_ee_filter_powered_by_event_espresso');
}
function tw_ee_filter_powered_by_event_espresso($content = '')
@Pebblo
Pebblo / ee_phone_input_validation.php
Created Jun 26, 2019
Example of how to override the validation stratey used on a EE_Phone_Input field.
View ee_phone_input_validation.php
<?php //Please do not include the opening PHP tag
add_filter('FHEE__EE_Form_Input_Base___construct__input_args', 'tw_ee_EE_Form_Input_Base___construct__input_args', 10, 2);
function tw_ee_EE_Form_Input_Base___construct__input_args( $input_args, $input ) {
if( $input instanceof EE_Phone_Input ) {
if( $input->has_validation_strategy('EE_Text_Validation_Strategy') ) {
$input->remove_validation_strategy('EE_Text_Validation_Strategy');
$input->add_validation_strategy(
new EE_Text_Validation_Strategy(
__('Please enter a valid phone number. Eg 123-456-7890 or 1234567890', 'event_espresso'),
@Pebblo
Pebblo / tw_ee_translate_strings.php
Created May 9, 2019
Example of how you can translate strings within Event Espresso via a filter, this function changes the 'Add to iCal Calendar' string to 'Add to Calendar'
View tw_ee_translate_strings.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function mycustom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
//'Original string' => 'Translated string',
'Add to iCal Calendar' => 'Add to Calendar',
@Pebblo
Pebblo / ee_espresso_google_map_link.php
Last active May 3, 2019
Copy of the espresso_google_map_link() which uses HTTPS, place this in a custom functions plugin to override the default function.
View ee_espresso_google_map_link.php
@Pebblo
Pebblo / filter_tax_archive_content.php
Last active May 2, 2019
Example of how to remove the EE filters used to add additional content on archives, this function removes content on the EE category archives.
View filter_tax_archive_content.php
<?php //Please do not include the opening PHP tag if you already have one
function tw_ee_remove_details_from_taxonomy() {
if( is_tax( 'espresso_event_categories') ) {
add_filter ('the_content', 'tw_ee_remove_details_from_taxonomy_content', 100 );
}
}
add_action( 'template_redirect', 'tw_ee_remove_details_from_taxonomy' );
function tw_ee_remove_details_from_taxonomy_content( $content ) {
@Pebblo
Pebblo / tw_ee_add_last_payment_method_to_csv.php
Last active Apr 25, 2019
This function adds the last payment method selected on a transaction if there are no payments on the transaction.
View tw_ee_add_last_payment_method_to_csv.php
<?php //Please do not include the opening PHP tag if you already have one
add_filter('FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array', 'tw_ee_add_last_payment_method_to_csv', 10, 2);
function tw_ee_add_last_payment_method_to_csv($reg_csv_array, $reg_row) {
//If this is now a primary registrant row, return and do nothing
if($reg_row['Registration.REG_count'] != '1'){
return $reg_csv_array;
}
@Pebblo
Pebblo / tw_ee_exclude_inputs_from_spco_copy_function.php
Last active Apr 18, 2019
Example of how to override the SPCO.calculate_target_attendee_input_id method so that you can exclude specific inputs from being copied.
View tw_ee_exclude_inputs_from_spco_copy_function.php
<?php //Please do not include the opening PHP tag if you already have one
// This function allows you to set inputs to be skipped during the copy attendee info function shown on SPCO.
// It currently skips the 'fname', 'lname', 'email' questions but you can add your own input ID's to the exclude_array.
function tw_ee_exclude_inputs_from_spco_copy_function() {
wp_add_inline_script(
'single_page_checkout',
"jQuery( document ).ready(function($) {
SPCO.calculate_target_attendee_input_id = function ( primary_reg_input, targeted_attendee) {
var new_input_id = '';
@Pebblo
Pebblo / example.php
Last active Apr 16, 2019
Example of how to set the 'View Details' button to open in a new window.
View example.php
<?php //Please do not include the opening PHP tag if you already have one.
add_filter('FHEE__EventEspresso_modules_ticket_selector_DisplayTicketSelector__displayViewDetailsButton__url_target_blank',
'tw_ee_external_url_ViewDetailsButton_new_window',
10,
2
);
function tw_ee_external_url_ViewDetailsButton_new_window($target_blank, $DisplayTicketSelectorObj ) {
You can’t perform that action at this time.