Skip to content

Instantly share code, notes, and snippets.

@joshfeck
joshfeck / organizer_event_linked_data.php
Created May 1, 2020
Add "organizer" linked data to event schema markup. Event Espresso 4
View organizer_event_linked_data.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__json_linked_data_for_event__template',
'my_organizer_to_linked_data_for_event'
);
function my_organizer_to_linked_data_for_event() {
$o_name = get_post_meta(get_the_ID(), 'organizer_name', true);
@joshfeck
joshfeck / cancelled_regs.php
Last active May 1, 2020
Removed cancelled registrations from default view. Event Espresso 4 Registrations admin page
View cancelled_regs.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__Registrations_Admin_Page___get_where_conditions_for_registrations_query',
'jf_ee_reg_list_table_reg_status_where',
11,
2
);
function jf_ee_reg_list_table_reg_status_where(
@joshfeck
joshfeck / expired-event-message.php
Created Apr 23, 2020
Show a message when it's an expired event. Event Espresso 4.
View expired-event-message.php
<?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_after_event_date',
function($post) {
$event = EEH_Event_View::get_event($post->id);
$status = $event instanceof EE_Event ? $event->get_active_status() : '';
if ($status == 'DTE') {
echo '<h4>This event is expired and not part of the 2020 schedule.</h4>';
@joshfeck
joshfeck / stripe_desc_email.php
Created Apr 22, 2020
Append the primary registrant's email address to the end of the Stripe order description. Event Espresso 4.
View stripe_desc_email.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EEG_Stripe_Onsite__doDirectPaymentWithPaymentIntents__payment_intent_data',
'stripe_elements_cf_order_desc_email',
10,
4
);
function stripe_elements_cf_order_desc_email(
@joshfeck
joshfeck / canada_taxes.php
Created Apr 16, 2020
GST, HST, PST, and QST for Canada eh? Event Espresso 4.
View canada_taxes.php
<?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 ACTIVATE THE "ADDRESS QUESTION GROUP"
* THEN SET THE STATE/PROVINCE QUESTION TO BE REQUIRED
*
* BECAUSE THIS QUESTION SHOULD ONLY BE ASKED ONCE PER TRANSACTION
@joshfeck
joshfeck / content-espresso_events-shortcode.php
Created Apr 16, 2020
Example of a custom template for the [ESPRESSO_EVENTS] shortcode. You can upload this to your WP child theme or into /wp-content/uploads/espresso/templates
View content-espresso_events-shortcode.php
<?php
/**
* This template will display a list of events - copy it to your theme folder
*
* @ package Event Espresso
* @ author Seth Shoultes
* @ copyright (c) 2008-2013 Event Espresso All Rights Reserved.
* @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing *
* @ link http://www.eventespresso.com
* @ version 4+
@joshfeck
joshfeck / auto-fill_country_stripe.php
Created Apr 14, 2020
Auto-fill County in billing form for Stripe. Event Espresso 4
View auto-fill_country_stripe.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// remove "add new state microform" from billing form
add_action(
'AHEE__EE_System__set_hooks_for_shortcodes_modules_and_addons',
function() {
remove_filter(
'FHEE__EE_SPCO_Reg_Step_Payment_Options___get_billing_form_for_payment_method__billing_form',
array(
@joshfeck
joshfeck / yoast_seo_boxes.php
Created Apr 13, 2020
Activate Yoast SEO plugin's meta box on Event Espresso CPT editor routes.
View yoast_seo_boxes.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('plugins_loaded', 'my_ee_yoast_seo_box');
function my_ee_yoast_seo_box() {
if (
! empty($_GET['page'])
&&
in_array(
@joshfeck
joshfeck / line_item_display_spco.php
Created Apr 9, 2020
A simple and quick example of how to use filter hooks to customize the registration checkout display under the "Name and Description" column. Event Espresso 4.
View line_item_display_spco.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EE_Default_Line_Item_Display_Strategy__item_row__name',
function($name, $line_item) {
return $line_item->ticket_event_name() . '<br>';
},
10,
2
@joshfeck
joshfeck / exclude_venue_calendar.php
Created Apr 1, 2020
Exclude events with venue identifier "online" from being displayed in the EE4 calendar
View exclude_venue_calendar.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EED_Espresso_Calendar__get_calendar_events__query_params',
'my_exclude_online_venue_calendar_filter',
10,
7
);
You can’t perform that action at this time.