Skip to content

Instantly share code, notes, and snippets.

@joshfeck
joshfeck / grid.css
Created February 13, 2020 23:40
custom EE grid CSS example
.ee_grid_box_v2.item {
width: 190px !important;
}
.ee_grid_box_v2.item img {
width: 190px !important;
}
.ee_overlay {
background: rgba(0, 0, 0, 0.5) !important;
@joshfeck
joshfeck / wp_user_shortcode.php
Created February 13, 2020 23:14
Change [ESPRESSO_MY_EVENTS template=simple_list_table] shortcode output to display only approved registrations. EE4 + WPUser integration.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__Espresso_My_Events__getTemplateObjects__query_args',
'jf_ee_filter_my_events_approved_regs',
10,
3
);
@joshfeck
joshfeck / beaver.php
Created February 11, 2020 16:54
Don't display Event Espresso Maintenance Mode notification if Beaver Builder editor is active. Event Espresso 4 + Beaver Builder. Add this code snippet into its own little WordPress plugin and activate it.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'shutdown',
function(){
if(
class_exists('FLBuilderModel')
&& class_exists('EE_Maintenance_Mode')
&& FLBuilderModel::is_builder_active()
@joshfeck
joshfeck / grid-past-events-shortcode-plugin.php
Last active February 6, 2020 01:05
Past events grid shortcode plugin. Event Espresso 4 + the Grid template add-on
<?php
/**
* @package EE_Event_List_Past_Events_Grid_Shortcode
* @version 1.0
*/
/*
Plugin Name: Event Espresso Past Events Grid Shortcode
Plugin URI: https://github.com/eventespresso/ee-code-snippet-library
Description: Add [espresso_past_events_grid] shortcode to a post or page to display a grid of past events.
Author: Josh Feck
@joshfeck
joshfeck / address_select_new_event.php
Created January 23, 2020 20:57
Add this snippet to your Event Espresso 4/WordPress site and when you go to add a new event, the Address Question Group will be pre-selected by default.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE_event_editor_questions_notice',
'my_select_address_for_primary_question_groups'
);
function my_select_address_for_primary_question_groups() {
if( did_action(
'FHEE__EE_Admin_Page___load_page_dependencies__after_load__espresso_events__create_new'
@joshfeck
joshfeck / ee_stripe_description.php
Created January 11, 2020 01:40
Custom Stripe Elements description field
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EEG_Stripe_Onsite__doDirectPaymentWithPaymentIntents__payment_intent_data',
'stripe_elements_cf_order_desc', 10, 4
);
function stripe_elements_cf_order_desc(
$stripe_data,
$payment,
@joshfeck
joshfeck / ticket_selector_styles.php
Created January 8, 2020 02:51
Add inline CSS to ticket selector using PHP. Useful for customizing the ticket selector and embedded ticket selector. Event Espresso 4.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__ticket_selector_chart__template__before_ticket_selector',
'ee_add_ticket_selector_css'
);
function ee_add_ticket_selector_css() {
$custom_css =
".ticket-sales-expired, .ticket-pending {display:none;}";
@joshfeck
joshfeck / cfpro_fix.php
Created December 18, 2019 21:25
Fix for the conference pro theme to avoid issues with html select fields.
<?php
/*
Plugin Name: Conference Pro theme select input fix
Description: Restores standard web browser behavior for html selects on a specific page (in this case, the checkout page)
Author: Event Espresso support
Version: 1.0
*/
add_action('wp_enqueue_scripts', 'my_remove_conf_pro_conflict_script', 99);
function my_remove_conf_pro_conflict_script() {
@joshfeck
joshfeck / natopa.php
Created December 10, 2019 22:52
Change "Not Approved" text to "Pending Approval" in Event Espresso 4
function im_custom_filter_gettext(
$translated,
$original,
$domain
) {
$strings = array(
'Not Approved' => 'Pending Approval',
'not approved' => 'Pending Approval',
// You can add some more strings here
);
@joshfeck
joshfeck / csv_report_no_headings.php
Created November 14, 2019 23:19
Remove CSV report column headings. Event Espresso 4
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_remove_labels_from_csv_column_headings(
$reg_csv_array,
$reg_row
) {
$i = 0;
foreach ($reg_csv_array as $key => $value) {
unset($reg_csv_array[$key]);