This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not include the opening PHP tag if you alreayd have one. | |
function tw_ee_cal_remove_anchors(){ | |
wp_add_inline_script( | |
'espresso_calendar', | |
'jQuery( \'#ee-category-legend-ul a[href*="#espresso_calendar"]\' ).each(function() { | |
this.href = this.href.split("#")[0]; | |
});' | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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_additional_finance_columns', | |
10, | |
2 | |
); | |
function tw_ee_add_additional_finance_columns( $reg_csv_array, $reg_row ) { | |
$registration = EEM_Registration::instance()->get_one_by_ID( $reg_row['Registration.REG_ID'] ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Please do not include the opneing PHP tag if you already have one. | |
// Example of how to exclude events within a specific category (based on term ID) from the EE event archive. | |
function tw_ee_filter_pre_get_posts( $query ) { | |
if ( $query->is_main_query() && $query->is_archive('espresso_events') ) { | |
$query->set( 'tax_query', array( | |
array( | |
'taxonomy' => 'espresso_event_categories', | |
'field' => 'term_id', | |
'terms' => 21, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Please do not include the opening PHP tag if you do not alread have one | |
// Example of how to override the capability check on the 'Contact List' tab shown on Event Espresso -> Registrations | |
// This function simply returns false for that cap check unless the current user account has the 'manage_options' cap on the account. | |
add_filter('FHEE__EE_Capabilities__current_user_can__cap__espresso_registrations_contact_list', 'ee_tw_filter_contact_list_tab', 10, 2); | |
function ee_tw_filter_contact_list_tab($cap, $id) { | |
if(! current_user_can('manage_options') ){ | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Please do not include the opening PHP tag if you already have one. | |
function tw_ee_theme_ee_archive_taxonomy_title( $title ) { | |
if( is_tax( 'espresso_event_categories' )) { | |
return 'Courses for ' . single_term_title( '', false ); | |
} | |
return $title; | |
} | |
add_filter( 'get_the_archive_title', 'tw_ee_theme_ee_archive_taxonomy_title' ); |