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 / export.php
Created Jun 12, 2019
EE3 Export function, patched for regional managers
View export.php
<?php
// Export data for event, called by excel request below
if (!function_exists('espresso_event_export')) {
function espresso_event_export($ename) {
global $wpdb, $org_options;
$sql = '';
$htables = array();
$htables[] = 'Event Id';
@joshfeck
joshfeck / ee_ticket_list_shortcode.php
Last active Jun 21, 2019
Shortcode to print a list of ticket types and their number of tickets sold for one event. example usage: [ee_ticket_list_for_event id=40221]
View ee_ticket_list_shortcode.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_shortcode( 'ee_ticket_list_for_event', 'ee_ticket_list_for_event_shortcode' );
function ee_ticket_list_for_event_shortcode( $atts ) {
$atts = shortcode_atts( array(
'id' => 0
), $atts, 'ee_ticket_list_for_event' );
if($atts['id'] == 0){
return;
@joshfeck
joshfeck / people_cpt_archive_remove.php
Created May 17, 2019
Remove display of "People" when it's an EE4 event archive (category or cpt archive) page
View people_cpt_archive_remove.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters',
function(){
remove_action(
'AHEE__EED_Events_Archive__use_filterable_display_order__after_add_filters',
array('EED_People_Event_Template_Parts', 'add_people_event_details_filters'),
10
@joshfeck
joshfeck / calendar_spaces_left.php
Created Apr 29, 2019
Change count of "spaces" for calendar tooltip to number of total tickets available before any sales. Event Espresso 4
View calendar_spaces_left.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_change_calendar_spaces_left(
$text,
$datetime
) {
$text = $datetime->sum_tickets_initially_available();
return $text;
}
@joshfeck
joshfeck / ee_mu_plugin_no_email.php
Created Apr 18, 2019
WordPres mu-plugin to deactivate all Event Espresso 3 email sending functions
View ee_mu_plugin_no_email.php
<?php
/*
Plugin Name: mu-plugin (must use) that deactivates all emails for Event Espresso 3
*/
if (!function_exists('event_espresso_send_email')) {
function event_espresso_send_email($params) {
return;
}
@joshfeck
joshfeck / espresso-grid-template.template.php
Last active Apr 17, 2019
See lines 16 and 42-46 for an example of how to add the name of the month to the Events Grid View
View espresso-grid-template.template.php
<?php
// Options
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
$temp_month = '';
$reg_button_text = !isset($button_text) ? __('Register Now!', 'event_espresso') : $button_text;
$alt_button_text = !isset($alt_button_text) ? __('View Details', 'event_espresso') : $alt_button_text;//For alternate registration pages
if ( have_posts() ) :
// allow other stuff
@joshfeck
joshfeck / venue_city_search.php
Created Apr 1, 2019
Filter function to add event search by Venue city. Event Espresso 4. This will affect the speed of the page load for search results.
View venue_city_search.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__Events_Admin_Page__get_events__where',
'ee_add_venue_city_search_field',
10,
2
);
function ee_add_venue_city_search_field( $where, $data ) {
@joshfeck
joshfeck / ee_archive_remove.php
Created Mar 28, 2019
Remove the standard Event Espresso Events custom post type archive
View ee_archive_remove.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_Register_CPTs__get_CPTs__cpts',
'ee_remove_event_cpt_archive'
);
function ee_remove_event_cpt_archive( $cpt_registry_array ) {
if ( isset( $cpt_registry_array['espresso_events'] ) ) {
$cpt_registry_array['espresso_events']['args']['has_archive'] = false;
@joshfeck
joshfeck / venue_mods.php
Created Mar 4, 2019
Move venue address so it appears before venue content. Event Espresso 4
View venue_mods.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action('pre_get_posts', 'my_change_venue_details');
function my_change_venue_details() {
global $post;
if ($post instanceof WP_Post && $post->post_type == 'espresso_venues' && is_single()) {
remove_filter('the_content', array(EED_Venue_Single::instance(), 'venue_location'), 110, 1);
add_filter('the_content', 'add_venue_details_in_custom_order', 120, 1);
}
@joshfeck
joshfeck / mandrill.php
Created Feb 13, 2019
Fixes the mandrill's silent discard of cc.
View mandrill.php
/**
* Fixes the mandrill's silent discard of cc.
*/
//first add filter to EE's email process to modify `cc:` header to `x-cc` so it gets past the initial mandrill header setup.
add_filter('FHEE__EE_Email_messenger___headers', function($headers) {
foreach ($headers as $header) {
if (strpos($header, 'cc: ') !== false) {
$headers[] = 'x-cc: ' . str_replace('cc: ', '', $header);
}
}
You can’t perform that action at this time.