Skip to content

Instantly share code, notes, and snippets.

add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1);
function espresso_create_wp_user($attendee_data) {
if( username_exists( $attendee_data['email'] ) == NULL ) {
global $org_options;
// Generate the password and create the user
$password = wp_generate_password( 12, false );
$user_id = wp_create_user( $attendee_data['email'], $password, $attendee_data['email'] );
// Set the users details
@Apina
Apina / template.php
Last active December 18, 2015 22:49 — forked from jazzsequence/template.php
Please see https://gist.github.com/joshfeck/52ac749150322a2e4221 --- Event Espresso invoice template including surcharge/VAT support. This file should go in your /wp-content/uploads/espresso/gateways/invoice directory.
Please see https://gist.github.com/joshfeck/52ac749150322a2e4221
@Apina
Apina / espresso_table_display_table_function.php
Created July 10, 2013 13:47 — forked from joshfeck/espresso_table_display_table_function.php
custom espresso_display_table function that makes it possible to order by time instead of ordering by date only. Replaces the function of the same name in the espresso_table.php template
/*
Shortcode Name: Espresso Table
Author: Seth Shoultes
Contact: [email protected]
Website: http://www.eventespresso.com
Description: Only show events in a CATEGORY within a certain number number of days into the future and a qty. The example below only shows events in a certain category that start within 30 days from the current date.
Usage Example: [ESPRESSO_TABLE max_days="30" qty="3" category_identifier="gracecard" order_by="state"]
Custom CSS for the table display
Notes: This file should be stored in your "/wp-content/uploads/espresso/templates/" folder and you should have the custom_includes.php files installed in your "/wp-content/uploads/espresso/" directory.
*/
@Apina
Apina / EE set calendar date
Created July 15, 2013 09:50
EE set the calendar to show a specific date - this goes in the espresso-celendar.php file approx line 860. Note that month starts at 0 (zero) not 1, so code below is showing 21st March 2013
//this is just showing you where the code needs to go
if( ee_parentHeight < ee_newHeight ) {
ee_newHeight = ee_newHeight + 30;
dayCnt.parents('tr').height( ee_newHeight ).css({ 'height' : ee_newHeight + 'px' });
}
}
});
@Apina
Apina / EE Remove gateways by event ID
Created November 15, 2013 07:57
Remove gateways by event ID Please note that if you want to do this with other gateways, you will need to check the action hook in each gateway as they may well be slightly different (e.g. invoice doesn't currently have the _2 at the end).
function htrappfae_remove_check_from_event($payment_data) {
extract( $payment_data );
if ( $event_id==8) { //check to see if this is the event with the ID of #8
//echo "Event Espresso ID: $event_id";
remove_action('action_hook_espresso_display_offline_payment_gateway_2','espresso_display_check' );
remove_action('action_hook_espresso_display_offline_payment_gateway_2', 'espresso_display_purchase_order');
}
}
add_action ( 'action_hook_espresso_display_offline_payment_gateway', 'htrappfae_remove_check_from_event',9 );
@Apina
Apina / EE ticket count modify
Created November 25, 2013 10:03
EE modify the ticket count
function change_ticket_count($attendee_data) {
if($attendee_data['event_id'] != '166') { return false;}
global $wpdb;
$wpdb->update( EVENTS_ATTENDEE_TABLE, array("quantity" => "5"), array("id" => $attendee_data['attendee_id']), array("%d"), array("%d") );
return;
}
add_action('action_hook_espresso_save_attendee_data', 'change_ticket_count');
@Apina
Apina / EE Custom Search
Last active December 30, 2015 00:09
EE Modified search this should be added to the Custom files addon (custom_shortcodes) as it is a separate shortcode It allows expired events to be disregarded from the search results
@Apina
Apina / event_registration_display.php
Created December 9, 2013 08:14
EE registration_page_display.php This modification is based off of the 3.1.36 version and allows the event description and times/prices etc to be seen when an event registration is closed, or not open yet and when the event has passed. Make sure that this file is copied to the wp-content/uploads/templates foldaer, and ALSO make sure that the reg…
<?php
//This is the registration form.
//This is a template file for displaying a registration form for an event on a page.
//There should be a copy of this file in your wp-content/uploads/espresso/ folder.
?>
<div id="espresso-event-id-<?php echo $event_id; ?>">
<div id="event_espresso_registration_form" class="event-display-boxes ui-widget">
<?php
$ui_corner = 'ui-corner-all';
//This tells the system to hide the event title if we only need to display the registration form.
@Apina
Apina / EE email attachment
Created December 16, 2013 09:04
Send an attachment with an EE email - change the attachment location. Add this to the custom files add on (custom_functions.php)
function event_espresso_send_email($params) {
global $org_options;
do_action('action_hook_espresso_log', __FILE__, __FUNCTION__, '');
extract($params);
//Define email headers
$headers = "";
if ($org_options['email_fancy_headers']=='Y') {
$headers .= "From: " . $org_options['organization'] . " <" . $org_options['contact_email'] . ">\r\n";
$headers .= "Reply-To: " . $org_options['organization'] . " <" . $org_options['contact_email'] . ">\r\n";
} else {
@Apina
Apina / espresso-calendar.php
Created December 20, 2013 08:33
Calendar set date parameter. Adds the new parameters custom_year and custom_month that will allow you to define what month/year the calendar begins on. Usage: [ESPRESSO_CALENDAR custom_year="2014" custom_month="9"] (BOTH PARAMETERS ARE REQUIRED!) ***IMPORTANT*** This needs to be added to the bottom of espresso_calendar.js just before the closing…
<?php
/*
Plugin Name: Event Espresso - Calendar
Plugin URI: http://www.eventespresso.com
Description: A full calendar addon for Event Espresso. Includes month, week, and day views.
Version: 2.1.p
Author: Event Espresso
Author URI: http://www.eventespresso.com
Copyright 2013 Event Espresso (email : [email protected])