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 your already have one. | |
add_filter('FHEE__EventEspresso_core_services_bootstrap_BootstrapCore__buildRequestStack__stack_apps','tw_ee_remove_DetectLogin_middleware', 10, 1); | |
function tw_ee_remove_DetectLogin_middleware($stack_apps) { | |
unset($stack_apps['EventEspresso\core\services\request\middleware\DetectLogin']); | |
return $stack_apps; | |
} |
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_tweak_event_list_exclude_sold_out_events_where( $SQL, WP_Query $wp_query ) { | |
if ( isset( $wp_query->query_vars['post_type'] ) && ( $wp_query->query_vars['post_type'] == 'espresso_events' || ( is_array( $wp_query->query_vars['post_type'] ) && in_array( 'espresso_events', $wp_query->query_vars['post_type'] ) ) ) && ! $wp_query->is_singular ) { | |
global $wpdb; | |
$SQL .= "AND {$wpdb->prefix}posts.post_status != 'sold_out' "; | |
} | |
return $SQL; | |
} |
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_rerender(){ | |
wp_add_inline_script( | |
'espresso_calendar', | |
"jQuery(window).on('load', function() { | |
jQuery('#espresso_calendar').fullCalendar( 'render' ); | |
});" | |
); | |
} |
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. | |
function tw_ee_hide_primary_email(){ | |
if( is_user_logged_in() ) { | |
wp_add_inline_style( | |
'single_page_checkout', | |
'div[id*="ee-reg-form-qstn-grp-personal-information"] .ee-reg-qstn-email { | |
display: none; | |
}' | |
); | |
} |
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. | |
add_filter('FHEE__EEE_Infusionsoft_Line_Item__ext_sync_to_infusionsoft__product_type', 'tw_ee_is_promotion_line_item_type', 10, 2); | |
function tw_ee_is_promotion_line_item_type($is_product_type, $line_item); | |
//If processing a line item and te Promotions add-on is active. | |
if ($line_item instanceof EE_Line_Item && class_exists('EE_Promotion')) { | |
// Check if the object related to the line item as an EE_Promotion. | |
$obj = $line_item->get_object(); | |
if ($obj instanceof EE_Promotion) { | |
// Set line item type to be 'Special: Product' which is type 12. |
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_override_espresso_core(){ | |
wp_add_inline_script( | |
'espresso_core', | |
"jQuery(document).ready(function($){ | |
$.fn.extend({ | |
eeAddOverlay : function( opacity ) { | |
console.log('Testing'); | |
opacity = typeof opacity === 'undefined' || opacity > 1 ? 0.5 : opacity; |
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 inlue the opening PHP tag if you alread have one. | |
function tw_ee_espresso_events_table_template_empty_row() { | |
wp_add_inline_script( | |
'espresso_events_table_template', | |
'jQuery(document).ready(function($){ | |
$("#ee_filter_cat").change(function() { | |
$(".espresso-table-row.empty").remove(); | |
if( $(".espresso-table-row:visible").length === 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( 'AFEE__EED_Espresso_Calendar__get_calendar_events__public_event_stati', 'tw_ee_add_private_events_to_cal_with_cap_check', 10, 1); | |
function tw_ee_add_private_events_to_cal_with_cap_check($public_event_stati) { | |
// Add private events if the current user can view them. | |
if (EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { | |
$public_event_stati[] = EEM_Event::post_status_private; | |
} | |
return $public_event_stati; |
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 // Do not include the opening PHP tag if you already have one. | |
// Force Porto theme to load the 'right-sidebar' layout and 'home-sidebar'. | |
add_filter('porto_meta_layout', 'tw_ee_filter_porto_meta_layout', 10, 1); | |
function tw_ee_filter_porto_meta_layout( $settings ) { | |
if( is_singular('espresso_events') ) { | |
$settings[0] = 'right-sidebar'; | |
// Change this to the slug of the sidebar you want to load. | |
$settings[1] = 'home-sidebar'; | |
} |
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 // Do not add the opening PHP tag if you already have one. | |
function tw_ee_mer_change_event_list_url_from_term($default_event_list){ | |
// Check if this is an ajax request. | |
if (wp_doing_ajax()){ | |
// Check we have an event id. | |
if (!empty($_POST['tkt-slctr-event-id'])) { | |
$EVT_ID = absint($_POST['tkt-slctr-event-id']); | |
if (has_term( 'courses-seminars', 'espresso_event_categories', $EVT_ID ) ){ | |
return 'https://domain.com/courses-seminars/'; |