Skip to content

Instantly share code, notes, and snippets.

Josh Feck joshfeck

Block or report user

Report or block joshfeck

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:2c216426c751fd6c440ce2a5c9c416ea
<?php
// Options
$date_format = get_option( 'date_format' );
$time_format = get_option( 'time_format' );
// Load Venue View Helper
EE_Registry::instance()->load_helper('Venue_View');
//Defaults
$reg_button_text = !isset($reg_button_text) ? __('Register', 'event_espresso') : $reg_button_text;
$alt_button_text = !isset($alt_button_text) ? __('View Details', 'event_espresso') : $alt_button_text;//For alternate registration pages
$sold_out_button_text = !isset($sold_out_button_text) ? __('Sold Out', 'event_espresso') : $sold_out_button_text;//For sold out events
@joshfeck
joshfeck / example.php
Last active Aug 3, 2018 — forked from Pebblo/example-multiple-caps.php
Example of how to dynamically remove the current registrations ticket capability (if set) from the current user.
View example.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_action(
'AHEE__EE_Registration_Processor__trigger_registration_update_notifications',
'my_remove_one_time_invitation_from_user',
10,
2
);
function my_remove_one_time_invitation_from_user(
$registration,
@joshfeck
joshfeck / ee_display_download_tickets.php
Last active Jun 20, 2018 — forked from Pebblo/ee_display_download_tickets.php
Add a 'Download your tickets' button & the QR code to the EE4 thank you page. The hook in use adds the button & QR code before the overview, just after 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.
View ee_display_download_tickets.php
<?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() ) {
@joshfeck
joshfeck / csv_transaction.php
Last active Feb 8, 2018 — forked from Pebblo/csv_transaction.php
add a column to the Event Espresso 4 Registrations CSV report that displays the total tax amount for the transaction
View csv_transaction.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_filter( 'FHEE__EE_Export__report_registrations__reg_csv_array', 'espresso_add_total_taxes_column', 10, 2);
function espresso_add_total_taxes_column( $reg_csv_array, $reg_row ) {
$registration = EEM_Registration::instance()->get_one_by_ID( $reg_row['Registration.REG_ID'] );
$sub_line_item_details = array();
if( $registration instanceof EE_Registration && $registration->is_primary_registrant() ) {
$sub_line_items = EEM_Line_Item::instance()->get_all(
array(
@joshfeck
joshfeck / functions.php
Last active Oct 16, 2017 — forked from Pebblo/functions.php
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.
View functions.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
// Display a contact form when the event is sold out
// to be used as a waiting list
function ee_espresso_clean_event_status( $event ) {
$status = $event instanceof EE_Event ? $event->get_active_status() : 'inactive';
return $status;
}
@joshfeck
joshfeck / example.php
Last active Feb 2, 2017 — forked from Pebblo/example.php
How to filter the 'Event Cart' text to use something else in its place, in this example just 'Cart'
View example.php
<?php //Please do not include the opening PHP tag if you already have one.
function tw_ee_return_cart() {
return 'Cart';
}
add_filter( 'FHEE__EED_Multi_Event_Registration__set_definitions__event_cart_name', 'tw_ee_return_cart' );
// also filter the empty cart message:
function my_ee_cart_is_empty() {
@joshfeck
joshfeck / add_location_to_calendar_event.php
Created Jan 19, 2017
Adds the event location to the EE4 calendar event. Requires EE4.
View add_location_to_calendar_event.php
function jv_ee_add_location_to_calendar_event( $text, $datetime, $event ) {
if ( $event instanceof EE_Event ) {
$venue = $event->get_first_related( 'Venue' );
if ( $venue instanceof EE_Venue ) {
$venue_name = $venue->name();
$text .= '<span>Location: ' . $venue_name . '</span>';
}
}
return $text;
}
@joshfeck
joshfeck / next-previous.php
Last active Oct 18, 2016 — forked from lorenzocaum/new_gist_file.md
Add a previous event and next event link to the end of the single event pages in Event Espresso 4
View next-previous.php
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
//* Add a previous event and next event link to single event pages in Event Espresso 4
function ee_previous_event_next_event_navigation(){
?>
<div class="ee-after-event-navigation ee-clearfix">
<div class="ee-after-event-navigation-previous" style="float:left"><?php previous_post_link('&laquo; %link', 'Previous Event: %title'); ?></div>
<div class="ee-after-event-navigation-next" style="float:right"><?php next_post_link('%link &raquo; ', 'Next Event: %title'); ?></div>
</div>
View properties-cpt.php
<?php
/*
Plugin Name: Custom Post Type Plugin
Description: Properties Custom Post Type.
*/
/*
* Creating a function to create our CPT
*/
@joshfeck
joshfeck / espresso_create_wp_user.php
Last active Aug 29, 2015 — forked from Pebblo/espresso_create_wp_user.php
Adds a new user account and sends a new user email after registering for an event. Requires EE3 and its WP user integration add-on.
View espresso_create_wp_user.php
<?php
add_action('action_hook_espresso_save_attendee_data','espresso_create_wp_user', 10, 1);
function espresso_create_wp_user($attendee_data) {
if( email_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'] );
You can’t perform that action at this time.