Skip to content

Instantly share code, notes, and snippets.

View lorenzocaum's full-sized avatar

Lorenzo Orlando Caum lorenzocaum

View GitHub Profile
@Pebblo
Pebblo / ee-site-specific-plugin.php
Last active February 19, 2016 14:35
A site specific plugin that can be used to remove the Extensions & Services menu items from both the Admin and the Admin bar for all users apart from those with the manage_options capability (usually this would be Administrators)
<?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! */
//Remove the Extensions & Services menu for all but admins with manage_options cap
function tw_ee_remove_services_menu() {
if( !current_user_can( 'manage_options' ) ) {
remove_submenu_page( 'espresso_events', 'espresso_packages' );
@joshfeck
joshfeck / event_duration.php
Created February 18, 2016 00:18
Prints a message regarding the duration of the event. For 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_print_event_duration', 10 );
function ee_print_event_duration( $event ) {
$datetimes = $event->datetimes();
foreach($datetimes as $datetime){
if ( $datetime instanceof EE_Datetime ) {
$start = $datetime->get_raw('DTT_EVT_start');
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// move promotions table row to just before total table row
//
function move_promotion_table_row() {
?>
<script>
jQuery( document ).on('ajaxComplete ready', function() {
jQuery('table#spco-payment-info-table .spco-grand-total')
<?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 / datepicker.php
Last active February 13, 2016 00:45
Change the Event Espresso 4 datepicker format so dates are formatted like 31/01/2016 (dd/mm/yyyy)
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function jf_change_ee_reg_form_datepicker_format() {
?>
<script>
jQuery(document).ready(function($) {
$('.datepicker').datepicker({
changeYear: true,
yearRange: "1960:2010", // for more info see http://api.jqueryui.com/datepicker/#option-yearRange
@Pebblo
Pebblo / output_after_ticket_selector.php
Last active June 1, 2016 15:48
Output details just after the ticket selector, this hook passes the Event ID ($EVT_ID) and the EE_Event ($event) for use within the function if needed
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
//Output details just after the ticket selector, the function has the Event ID ($EVT_ID)
//and EE_Event object $event available for use.
function tw_output_details_after_the_ts( $EVT_ID, $event ) {
echo "<h1>TESTING TESTING</h1>";
}
@Pebblo
Pebblo / tw_custom_upcoming_events_widget.php
Last active February 4, 2019 12:12
This is a copy of the original EE upcoming events widget that includes a field to allow you to select the order of the events and also include a 'Show Only Expire' option within the show expired dropdown. This option will only show events in which the event end date has already passed.
<?php
/*
Plugin Name: Custom EE Upcoming Events Widget
Description: Add a custom Upcoming Events widger with a 'sort' field and 'Show Only Expired' option.
Author: Tony Warwick
Version: 1.1
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
class Custom_Upcoming_Events extends WP_Widget {
@joshfeck
joshfeck / include_custom_fields_csv.php
Last active July 5, 2019 17:40
from http://eventespresso.com/topic/export-custom-fields/ You can add this code to a functions plugin or into your WordPress theme's functions.php file. More info here: http://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/
<?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_meta_value_csv',
10,
2
);
function espresso_add_meta_value_csv( $reg_csv_array, $reg_row ) {
@Pebblo
Pebblo / ee_back_to_event_button.php
Last active April 4, 2016 18:04
Adds a 'Go back to {event}' button to the registration-checkout page, change the styling to suit - http://take.ms/VXbHG
<?php
/*
Plugin Name: EE Site Specific Plugin
Description: Add custom functions for Event Espresso 4 here.
*/
/* Begin Adding Functions Below This Line; Do not include an opening PHP tag as this sample code already includes one! */
//Add a 'Go back to the {event}' button below the registration form and payment selection.
function ee_display_return_to_event_on_spco(){
@Pebblo
Pebblo / ee_display_download_tickets.php
Created September 18, 2015 11:35
Add a 'Download your tickets' button to the EE4 thank you page. The hook in use adds the button above the overview, just under the confirmation order section. You will likely need to apply your own styles, possibly a container div and apply styles to that depending on how you want this to be displayed.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function ee_display_download_tickets( $transaction ) {
if ( $transaction instanceof EE_Transaction ) {
$primary_reg = $transaction->primary_registration();
if ( $primary_reg->is_approved() ) {