Skip to content

Instantly share code, notes, and snippets.

@joshfeck
joshfeck / nothing_in_event_queue.php
Last active September 19, 2018 03:27
Example code showing how to change the message and URL in the message that appears when no events are in the cart. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg',
'my_custom_nothing_in_event_queue_message'
);
function my_custom_nothing_in_event_queue_message() {
return sprintf(
'You need to %1$sReturn to our main ticket sales page%2$sselect at least one event%3$s before you can proceed with the registration process.',
UPDATE `wp_esp_ticket` SET `TKT_reserved` = '0';
UPDATE `wp_esp_datetime` SET `DTT_reserved` = '0';
@joshfeck
joshfeck / example_csv.php
Created September 11, 2018 21:35
Remove registrations with "Cancelled" status. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EE_Export__report_registration_for_event',
'my_exclude_cancelled_registrations_csv_report',
10,
2
);
function my_exclude_cancelled_registrations_csv_report(
@joshfeck
joshfeck / example_csv.php
Created September 11, 2018 21:35
Remove registrations with
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EE_Export__report_registration_for_event',
'my_exclude_cancelled_registrations_csv_report',
10,
2
);
function my_exclude_cancelled_registrations_csv_report(
@joshfeck
joshfeck / sharebox.php
Created September 7, 2018 22:21
Fixed sharebox.php for the Univero theme (from Themeforest)
<?php
global $post;
$args = array( 'position' => 'top', 'animation' => 'true' );
?>
<div class="ninzio-social-share">
<ul class="list-social bo-social-icons bo-sicolor list-unstyled">
<strong><?php echo esc_html__('Share this post: ','univero') ?></strong>
<?php if ( univero_get_config('facebook_share', 1) ): ?>
@joshfeck
joshfeck / example_js.php
Created September 7, 2018 17:10
Event Espresso 4: show only the first ticket option that's on sale
<?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_show_only_first_on_sale_ticket',
20
);
function my_ee_show_only_first_on_sale_ticket() {
$custom_js = 'jQuery(document).ready(function($){
@joshfeck
joshfeck / EE_SPCO_Reg_Step_Add_Extra_Step.class.php
Last active September 10, 2018 19:59
Add the following code snippet and file to your site specific plugin. Adds a first step to the progress display at the top of the Event Espresso Single Page checkout. The step is skipped.
<?php
class EE_SPCO_Reg_Step_Add_Extra_Step extends EE_SPCO_Reg_Step
{
/**
* constructor
*
* @param EE_Checkout $checkout
*/
public function __construct(EE_Checkout $checkout)
@joshfeck
joshfeck / ee3_example.php
Created August 28, 2018 17:33
Add the event date to the payment options page, EE3
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'action_hook_espresso_payment_page_bottom',
'my_add_event_date_to_payment_page',
10
);
function my_add_event_date_to_payment_page($event_id) {
echo '<p><span class="section-title">Start Date: </span>'
@joshfeck
joshfeck / people_cpt_order_example.php
Last active August 28, 2018 13:16
Manually re-order the Event Espresso People post type archive order with the Post Attributes -> Order field
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EventEspresso_core_domain_entities_custom_post_types_CustomPostTypeDefinitions__getCustomPostTypes',
'ee_modify_page_attributes_of_event_espresso_cpt'
);
function ee_modify_page_attributes_of_event_espresso_cpt( $cpt_registry_array ) {
if ( isset( $cpt_registry_array['espresso_people'] ) ) {
$cpt_registry_array['espresso_people']['args']['supports'] = array(
@joshfeck
joshfeck / filter_events_widget_example.php
Created August 22, 2018 18:19
Filter the Event Espresso upcoming events widget so it only includes events where their first datetime has not started yet.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EEW_Upcoming_Events__widget__where', 'my_custom_events_widget_where_params', 10, 3 );
function my_custom_events_widget_where_params( $where, $category, $show_expired ) {
if ( ! $show_expired ) {
$where['Datetime.DTT_EVT_start'] = array( '>=', EEM_Datetime::instance()->current_time_for_query( 'DTT_EVT_start' ) );
$where['Datetime.DTT_order'] = 1;
}
return $where;