Skip to content

Instantly share code, notes, and snippets.

Josh Feck joshfeck

Block or report user

Report or block joshfeck

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
@joshfeck
joshfeck / venue_calendar.php
Created Aug 16, 2019
Add venue information to the Event Espresso 4 calendar tooltip. You can add this code to a functions plugin or, if available, into your WordPress child theme's functions.php file.
View 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__EE_Calendar__get_calendar_events__tooltip_reg_btn_html',
'my_custom_calendar_tooltip_add_venue',
10,
3
);
function my_custom_calendar_tooltip_add_venue(
@joshfeck
joshfeck / checkins.php
Last active Aug 7, 2019
Add a timestamp column and change the sort order to the Attendee Checkin admin page. Event Espresso 4.
View checkins.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE_manage_event-espresso_page_espresso_registrations_columns',
'my_filter_registration_list_table_columns',
10,
2
);
add_action(
@joshfeck
joshfeck / tracking_code_example.php
Created Aug 2, 2019
Tracking code example for Event Espresso 4. Adds event-specific tracking code to the thank you page if "tracking_value" custom field is set in event.
View tracking_code_example.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__thank_you_page_overview_template__top',
'my_custom_tracking_code_function'
);
function my_custom_tracking_code_function($transaction) {
if ( $transaction instanceof EE_Transaction ) {
$registrations = $transaction->registrations();
@joshfeck
joshfeck / functions.php
Last active Jul 21, 2019
Past event archives page template for EE4. This can be adapted to most WP themes. Prints a simple unordered one page list of expired events.
View functions.php
<?php
// alter the query to only the primary datetimes that ended before today
// adjust query as desired
// add this to your child theme's functions.php file or into a custom plugin
function custom_posts_where_sql_for_only_expired() {
return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end < "' . current_time( 'mysql', TRUE ) . '" ';
}
View show_only_expired_events.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function custom_posts_where_sql_for_only_expired() {
return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end < "' . current_time( 'mysql', TRUE ) . '"
AND post_status = "publish"';
}
add_action( 'loop_start', 'my_custom_event_view_only_expired' );
@joshfeck
joshfeck / is_no_sku_for_you.php
Created Jul 19, 2019
Infusionsoft + Event Espresso 4. Do not send a product sku when adding/updating events & tickets
View is_no_sku_for_you.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EEE_Infusionsoft_Ticket__sync_to_infusionsoft__product_data',
'my_do_not_send_a_sku',
10,
2
);
function my_do_not_send_a_sku($product_data, $ticket) {
@joshfeck
joshfeck / simple_events.php
Last active Jul 18, 2019
simple EE4 event list query and display
View simple_events.php
<?php
// set up show expired = false
$where = array(
'Datetime.DTT_EVT_end' => array( '>=', current_time( 'mysql' )),
'status' => 'publish',
);
// run the query
if ( class_exists( 'EE_Registry' ) ) :
$events = EE_Registry::instance()->load_model( 'Event' )->get_all( array(
$where,
@joshfeck
joshfeck / eea_is_track_guests_to_primary.php
Created Jul 12, 2019
Event Espresso 4, Infusionsoft. Add a custom field value for "Primary Attendee" to guest contact records.
View eea_is_track_guests_to_primary.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_is_track_attendee_back_to_purchaser( $is_contact_data, $ee_attendee ) {
if( $ee_attendee instanceof EE_Attendee ) {
$checkout = EE_Registry::instance()->SSN->checkout();
if ( $checkout instanceof EE_Checkout ) {
$transaction = $checkout->transaction;
if ( $transaction instanceof EE_Transaction ) {
$primary_reg = $transaction->primary_registration();
@joshfeck
joshfeck / remove_copy_attendee_info.php
Created Jul 11, 2019
Event Espresso 4, remove copy attendee info template
View remove_copy_attendee_info.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EEH_Template__locate_template__full_template_paths',
'my_copy_attendee_info_template_do_not_load',
10,
2
);
function my_copy_attendee_info_template_do_not_load(
@joshfeck
joshfeck / yoast-seo-xml-single-event.php
Created Jul 5, 2019
Yoast SEO XML sitemap: remove the single-event archive URL from the sitemap
View yoast-seo-xml-single-event.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_seo_xml_sitemap_no_event_type_single($url, $type, $term) {
if (! isset($term->taxonomy)) {
return $url;
}
if ($term->taxonomy == 'espresso_event_type') {
$url = '';
}
You can’t perform that action at this time.