Skip to content

Instantly share code, notes, and snippets.

View Pebblo's full-sized avatar
🏠
Working from home

Tony Warwick Pebblo

🏠
Working from home
  • Event Espresso
  • Liverpool, UK
View GitHub Profile
@Pebblo
Pebblo / add_calendar_scripts.php
Last active September 19, 2024 11:23 — forked from joshfeck/add_calendar_scripts_everywhere.php
Add calendar scripts to a specific page. Page builder themes rejoice!
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'template_redirect', 'tw_add_ee_calendar_assets' );
function tw_add_ee_calendar_assets() {
// change is_page() parameter to match your calendar page slug
if ( class_exists( 'EED_Espresso_Calendar' ) && is_page( 'whats-on' ) ) {
global $is_espresso_calendar;
$is_espresso_calendar = TRUE;
add_action( 'wp_enqueue_scripts', array( EED_Espresso_Calendar::instance(), 'calendar_scripts' ) );
@Pebblo
Pebblo / my_custom_checkboxes_for_additional_question_groups.php
Last active January 8, 2024 23:49 — forked from joshfeck/my_custom_checkboxes_for_primary_question_groups.php
Check a question group box by default. For the Event Espresso 4 event editor. Additional Question group ID 1 (Personal Information).
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'AHEE_event_editor_questions_notice', 'my_custom_checkboxes_for_additional_question_groups' );
function my_custom_checkboxes_for_additional_question_groups() {
echo '<script>jQuery(
"#espresso_events_Registration_Form_Hooks_Extend_additional_questions_metabox input[value=\'1\']"
)
.prop( "checked", true );</script>';
}
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'wp_enqueue_scripts',
'tw_ee_change_default_ee_country_and_state_option',
20
);
function tw_ee_change_default_ee_country_and_state_option(){
$custom_js = 'jQuery(document).ready(function($){';
@Pebblo
Pebblo / add_currency_code_spco.php
Last active January 27, 2023 14:59 — forked from joshfeck/add_currency_code_spco.php
Add currency code to the checkout display in Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function my_ee_add_currency_checkout() {
wp_add_inline_script(
'single_page_checkout',
'jQuery( document ).one( "ajaxStop", function() {
jQuery("#spco-payment-info-table")
.find(".spco-grand-total .total:nth-of-type(2)")
.append("<span>(CHF)</span>");
@Pebblo
Pebblo / ee_tw_zero_vat_or_20.php
Last active October 6, 2022 19:16 — forked from joshfeck/canada_taxes.php
VAT 20 or 0? Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
/**
* PLEASE READ AND FOLLOW ALL INSTRUCTIONS IN CAPS
*
* IN ORDER FOR THIS TO WORK YOU NEED TO ADD A QUESTION USED FOR A TAX NUMBER
*
* BECAUSE THIS QUESTION SHOULD ONLY BE ASKED ONCE PER TRANSACTION
* YOU SHOULD ADD THE ABOVE QUESTION TO A GROUP ONLY ASKED FOR THE PRIMARY REGISTRANT
@Pebblo
Pebblo / example_csv.php
Last active October 4, 2022 11:56 — forked from joshfeck/example_csv.php
Only pull Approved registrations by default, order ASC by TXN_ID and Reg_count
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EE_Export__report_registration_for_event',
'tw_ee_registration_for_event_set_RAP_ASC',
10,
2
);
function tw_ee_registration_for_event_set_RAP_ASC($query_params, $event_id) {
@Pebblo
Pebblo / ical_offset_example.php
Last active July 26, 2022 15:56 — forked from joshfeck/ical_offset_example.php
This allows you to change the timezone used for the iCal data, if a custom field value is present it will be used to set the timezone on the datetime. Useful for sites that have events in different timezones
<?php //* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EED_Ical__download_ics_file_ics_data',
'my_custom_ical_timezone_output_filter',
10,
2
);
function my_custom_ical_timezone_output_filter(
$ics_data,
@Pebblo
Pebblo / ee_add_unique_attendee_validation.php
Last active May 10, 2022 20:09 — forked from joshfeck/ee_add_unique_email_validation.php
Add custom email field input validation to check for unique email addresses for each field. You can add this to a site specific plugin.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_add_unique_attendee_validation(){
wp_add_inline_script(
'single_page_checkout',
'jQuery( document ).ready(function($) {
$(".ee-reg-qstn-email").addClass("unique");
$(".ee-reg-qstn-fname").addClass("unique");
$(".ee-reg-qstn-lname").addClass("unique");
@Pebblo
Pebblo / add_user_cap.php
Created March 30, 2022 10:38 — forked from joshfeck/add_user_cap.php
Add a new capability to WP User account after they complete a registration for a specific event. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__EE_Transaction_Processor__update_transaction_and_registrations_after_checkout_or_payment',
'my_add_user_cap_for_ticket',
10,
2
);
@Pebblo
Pebblo / mer_scripts_everywhere.php
Last active February 18, 2022 18:26 — forked from joshfeck/mer_tribe_events.php
Make sure that the scripts and styles for the Multi Event Registration add-on cart are loaded on tribe_events event pages.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function my_add_mer_scripts_everywhere() {
wp_enqueue_style(
'espresso_multi_event_registration',
apply_filters(
'FHEE__EED_Multi_Event_Registration__enqueue_scripts__event_cart_css',
EE_MER_URL . 'css' . DS . 'multi_event_registration.css'
)