Skip to content

Instantly share code, notes, and snippets.

View lorenzocaum's full-sized avatar

Lorenzo Orlando Caum lorenzocaum

View GitHub Profile
@amdrew
amdrew / gist:40fcef36a7842d80f66c
Last active July 13, 2023 00:30
EDD 2.0 - Show discount field by default
<?php
/**
* Unhook default EDD discount field
*/
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 );
/**
* Add our own callback for the discount field, keeping the same CSS as before
*/
@Pebblo
Pebblo / avada.css
Last active February 4, 2022 12:58 — forked from joshfeck/avada.css
Avada theme responsive tickets fix
@media (max-width: 640px) {
.tkt-slctr-tbl,
.spco-ticket-details {
table-layout: fixed;
font-size: .8em;
}
.tkt-slctr-tbl tr td {
padding-left: 2px;
padding-right: 0;
}
@joshfeck
joshfeck / custom-ee-widget.php
Last active August 18, 2021 23:00
A clone of the stock EE4 Upcoming Events widget, in its own plugin
<?php
/*
Plugin Name: Alternative Event Espresso upcoming events widget
Description: A custom event list widget for Event Espresso 4
Version: 1.2
*/
// Register and load the widget
//
add_action( 'widgets_init', 'my_load_customEE_widget' );
@joshfeck
joshfeck / display_event_categories.php
Created April 18, 2016 15:14
Display the description for the category/categories that are assigned to a single event. Requires Event Espresso 4. You can add this code to a <a href="http://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/">functions plugin</a> or into your WordPress theme's functions.php file.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action( 'AHEE_event_details_before_the_content', 'ee_display_category_description_single_event' );
function ee_display_category_description_single_event( $post ) {
$taxonomy = 'espresso_event_categories';
$terms = get_the_terms( (int) $post->ID, $taxonomy );
if( !empty( $terms ) ) {
foreach( (array) $terms as $order => $term ) {
@joshfeck
joshfeck / details_waiting_list.md
Last active January 12, 2021 23:26
Add a ninja form to a Sold out Event Espresso 4 event. This is useful if you want to capture names and contact info from people that want to be signed up for a waiting list.
@mannieschumpert
mannieschumpert / gist:e5cec8723247f9490016
Created October 9, 2014 21:01
Remove Gravity Forms' "Add Form" button from all WYSIWYG editors
<?php
add_filter( 'gform_display_add_form_button', function(){return false;} );
<?php
/**
* Plugin Name: EDD Heartbeat API test plugin
* Description: Demonstrates how to use the Heartbeat API to update the payments count on the dashboard
*/
// Load the heartbeat JS
function edd_heartbeat_enqueue( $hook_suffix ) {
// Make sure the JS part of the Heartbeat API is loaded.
wp_enqueue_script( 'heartbeat' );
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
//* Disable email match check for logged out users
add_filter( 'EED_WP_Users_SPCO__verify_user_access__perform_email_user_match_check', 'ee_wp_users_remove_email_user_match_check_logged_out' );
function ee_wp_users_remove_email_user_match_check_logged_out() {
if ( ! is_user_logged_in() ) {
return false;
} else {
@joshfeck
joshfeck / functions.php
Last active July 21, 2019 22:40
Past event archives page template for EE4. This can be adapted to most WP themes. Prints a simple unordered one page list of expired events.
<?php
// alter the query to only the primary datetimes that ended before today
// adjust query as desired
// add this to your child theme's functions.php file or into a custom plugin
function custom_posts_where_sql_for_only_expired() {
return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end < "' . current_time( 'mysql', TRUE ) . '" ';
}
@joshfeck
joshfeck / add_venue_to_reports.php
Last active July 5, 2019 18:15
Adds a column to the registrations CSV in Event Espresso 4 to display the name of the event's venue
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter(
'FHEE__EventEspressoBatchRequest__JobHandlers__RegistrationsReport__reg_csv_array',
'espresso_add_venue_to_report',
10,
2
);
function espresso_add_venue_to_report( $reg_csv_array, $reg_row ) {