Skip to content

Instantly share code, notes, and snippets.

View lorenzocaum's full-sized avatar

Lorenzo Orlando Caum lorenzocaum

View GitHub Profile
@joshfeck
joshfeck / ee_wp_user_has_registered_before.php
Created February 22, 2017 19:50
Check to see if the logged in member has registered for this event, then display a message on the single event page. Requires Event Espresso 4 + the WP User Integration add-on.
<?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_post',
'my_add_content_event_if_logged_in_registered',
11
);
function my_add_content_event_if_logged_in_registered( $post ) {
if ( is_user_logged_in() && is_singular() ) {
@joshfeck
joshfeck / functions.php
Created November 15, 2016 17:20
This is an alternative way to display dates and times for the Event Espresso event page. Formats a single date time that spans multiple days as “Starts at <time> on <date> Ends at <time> on <date>”.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function espresso_list_of_event_dates( $EVT_ID = 0, $date_format = '', $time_format = '', $echo = TRUE, $show_expired = NULL, $format = TRUE, $add_breaks = TRUE, $limit = NULL ) {
$date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' );
$time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' );
$date_format = apply_filters( 'FHEE__espresso_list_of_event_dates__date_format', $date_format );
$time_format = apply_filters( 'FHEE__espresso_list_of_event_dates__time_format', $time_format );
EE_Registry::instance()->load_helper( 'Event_View' );
$datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired, FALSE, $limit );
@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 / change_button_text.php
Created May 23, 2016 20:13
Change the button text for one event, 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_Ticket_Selector__display_ticket_selector_submit__btn_text', 'my_custom_button_text', 10, 2 );
function my_custom_button_text( $btn_text, $event ) {
if ( $event->ID() == 51803 ) { // change this ID to match your event ID
$btn_text = 'Get on the bus!'; // change button text here
}
return $btn_text;
}
function my_move_australia_before_nz() {
?>
<script>
jQuery(document).ready(function($) {
var aussie = '.ee-reg-qstn-state optgroup[label="Australia"]';
var kiwi = '.ee-reg-qstn-state optgroup[label="New Zealand"]';
$(aussie).insertBefore(kiwi);
});
</script>
<?php
@joshfeck
joshfeck / paypal_filter.php
Last active April 29, 2016 17:39
Set the language of the PayPal payment page from 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__EEG_Paypal_Standard__set_redirection_info__arguments', 'jf_ee_add_paypal_language_code' );
function jf_ee_add_paypal_language_code( $redirect_args ) {
$redirect_args[ 'lc' ] = 'GB';
return $redirect_args;
}
@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 ) {
@joshfeck
joshfeck / single-espresso_venues.php
Created April 19, 2016 21:13
Single Venue template for Event Espresso 4 venues for use in a Genesis child theme.
<?php
remove_action ( 'genesis_loop', 'genesis_do_loop' ); // Remove the standard loop
add_action( 'genesis_loop', 'custom_espresso_venues_single_loop' ); // Add custom loop
// Optional: Remove post info
remove_action( 'genesis_before_post_content', 'genesis_post_info' );
remove_action( 'genesis_after_post_content', 'genesis_post_meta' );
function custom_espresso_venues_single_loop() {
if ( have_posts() ) :
// Start the Loop.
@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 ) {
@Pebblo
Pebblo / ee-site-specific-plugin.php
Last active December 4, 2017 12:47
Contains the filters used within EE4 Multi Event Registration to output text within the cart. You can use this to translate the strings within the cart. Places holders such as %s should remain but you can alter text before/after if needed.
<?php
/*
Plugin Name: Event Espresso site specific functions
Description: Add custom functions for Event Espresso to this plugin.
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
//Filter the 'Return to Event List' text.
function ee_change_events_list_btn_txt() {
return 'Return to Event List';
}