This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag | |
//* Load Lato and Merriweather Google fonts | |
add_action( 'wp_enqueue_scripts', 'bg_load_google_fonts' ); | |
function bg_load_google_fonts() { | |
wp_enqueue_style( 'google-fonts', '//fonts.googleapis.com/css?family=Lato:300,700|Merriweather:300,700', array(), CHILD_THEME_VERSION ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add this section to the end of gateways/invoice/init.php | |
// This is for the thank you page | |
if (!empty($_REQUEST['type']) && $_REQUEST['type'] == 'invoice') { | |
event_espresso_require_gateway("invoice/invoice_ipn.php"); | |
add_filter('filter_hook_espresso_transactions_get_attendee_id', 'espresso_transactions_invoice_get_attendee_id'); | |
add_filter('filter_hook_espresso_thank_you_get_payment_data', 'espresso_process_invoice'); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'] ); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Custom Post Type Plugin | |
Description: Properties Custom Post Type. | |
*/ | |
/* | |
* Creating a function to create our CPT | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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('« %link', 'Previous Event: %title'); ?></div> | |
<div class="ee-after-event-navigation-next" style="float:right"><?php next_post_link('%link » ', 'Next Event: %title'); ?></div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
OlderNewer