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 / ee_avada_remove_readd_filters.php
Last active November 16, 2022 12:55
Example of how to remove/re-add EE's filter on the_content when using Avada.
<?php // Do not include the opening PHP tag if you already have one.
add_action('awb_remove_third_party_the_content_changes', 'tw_ee_avada_remove_filters', 10);
function tw_ee_avada_remove_filters() {
remove_filter(
'the_content',
array('EED_Event_Single', 'event_details'),
EED_Event_Single::EVENT_DETAILS_PRIORITY
);
remove_filter(
@Pebblo
Pebblo / ticket_headings.php
Created October 11, 2021 15:28 — forked from joshfeck/ticket_headings.php
Example that shows how to add some headings between ticket selector rows. Requires WordPress + 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( 'wp_enqueue_scripts', 'my_ee_add_ticket_row_headings', 11 );
function my_ee_add_ticket_row_headings() {
wp_add_inline_script(
'ticket_selector',
'jQuery( document ).ready(function($) {
$(".ee-ticket-tees-for-keys-golf-tournament-executive-sponsor")
.before( "<tr><td colspan=\'3\'><h3>Tees For Keys</h3></td></tr>" );
@Pebblo
Pebblo / calendar-iframe-custom-styles.css
Last active September 29, 2021 10:38 — forked from joshfeck/calendar-print-styles.css
Custom styles for the Event Espresso 4 events calendar's iframe. Add the calendar-iframe-custom-styles.css file to your child theme (top level).
#ee-category-legend-ul #ee-category-li-70,
#ee-category-submit option[value=unlisted] {
display:none
}
@Pebblo
Pebblo / display_event_tags_and_categories.php
Last active July 21, 2021 17:20 — forked from joshfeck/display_event_categories.php
Display the description for the category/categories that are assigned to a single event. Requires Event Espresso 4. You can add this code to a <a href="http://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/">functions plugin</a> or into your WordPress theme's functions.php file.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'AHEE_event_details_before_the_content', 'ee_display_tags_and_categories_single_event' );
function ee_display_tags_and_categories_single_event( $post ) {
$taxonomy = 'espresso_event_categories';
$terms = get_the_terms( (int) $post->ID, $taxonomy );
$tags = get_the_tags( (int) $post->ID );
<?php
/*
Plugin Name: EE Custom Functions - Specific Functions Plugin
Description: Use this plugin to add custom functions to your site.
*/
// Change Mini Cart Widget ticket row.
function ee_mer_change_item_name($ticketrowname){
return $ticketrowname . ' (date test)';
}
@Pebblo
Pebblo / tw_ee_datepicker_readonly
Created September 8, 2020 10:21
Example of how you can set EE datepicker questions to be readonly which means users must use the datepicker and not type in values manually
<?php // Please do not include the opening PHP tag if you alreayd have one
// Example of how you can set EE datepicker questions to be readonly
// which means users must use the datepicker and not type in values manually.
add_action( 'wp_enqueue_scripts', 'tw_ee_datepicker_readonly', 11 );
function tw_ee_datepicker_readonly() {
wp_add_inline_script(
'single_page_checkout',
'jQuery(document).ready(function($){
$(".ee-datepicker-input-dv input").prop("readonly", true);
@Pebblo
Pebblo / tw_ee_payment_overview_url__query_args.php
Created September 1, 2020 21:41
Example of how to fix the payment_url value for registration that have been imported using rhe importer add-on with partial payments.
<?php // Please do not include the opening PHP tag if you already have one
function tw_ee_payment_overview_url__query_args($query_args, $registration) {
// Pull the transaction from the registration object.
$transaction = $registration->transaction();
// Check we have an EE_Transaction object
// Check the 'attendee_information' step has NOT been complete
// Check we have at least 1 payment related to the transaction
// (likely an imported registration with attendee_information not set to true)
if ($transaction instanceof EE_Transaction
<?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',
'tw_ee_filter_ics_data',
10,
2
);
@Pebblo
Pebblo / tw_ee_disable_acf_datetimepicker.php
Created August 12, 2020 15:56
How to prevent ACF from enqueing its own DatePicker on EE's editor.
<?php //Please do not include the opening PHP tag if you already have one.
add_filter('add_meta_boxes_espresso_events', 'tw_ee_disable_acf_datetimepicker');
function tw_ee_disable_acf_datetimepicker() {
add_filter('acf/settings/enqueue_datetimepicker', '__return_false');
add_filter('acf/settings/enqueue_datepicker', '__return_false');
}
@Pebblo
Pebblo / tw_eea_wp_user_login_password_reset.php
Created August 10, 2020 14:02
Example of how to include a 'Lost your password?' link on the WP User Integration add-on Login reg step.
<?php // Please do not include the opening PHP tag if you already have one
function tw_eea_wp_user_login_password_reset( $options, $form ) {
if( $form instanceof EE_Form_Section_Proper
&& isset( $options[ 'name' ] )
&& $options[ 'name' ] === 'ee-spco-wpuser_login-reg-step-form'
) {
$reset_url = esc_url( wp_lostpassword_url() );
$reset_link = '<a href="'. $reset_url .'">Lost your password?</a>';