Skip to content

Instantly share code, notes, and snippets.

@joshfeck
joshfeck / gist:7899284
Created December 10, 2013 20:48
Add this to the print stylesheet, or where ever your custom styles are located to make it so web pages do not get printed out on paper.
@media print{
* {display:none!important;}
}
@joshfeck
joshfeck / remove_invoice.php
Created December 17, 2013 23:27
This will make it so that the Invoice button does not display when registering for a specific event. In this example, the event ID is 74. You'll need to swap in the event ID for where you don't want the Invoice button to appear for.
<?php
function rpofse_remove_invoice_from_event($payment_data) {
extract( $payment_data );
if ( $event_id==74 ) { //check to see if this is the event with the ID of #74
remove_action( 'action_hook_espresso_display_offline_payment_gateway', 'espresso_display_invoice' );
}
}
add_action ( 'action_hook_espresso_display_offline_payment_gateway', 'rpofse_remove_invoice_from_event', 9 );
@joshfeck
joshfeck / single-espresso_events.php
Created December 31, 2013 21:48
This is a Genesis-ready page template that displays a single Event Espresso event. This gets added to your Genesis child theme's folder.
<?php
/**
* Template Name: Event Details
*
* This is a Genesis-ready template that will display a single event
*
* Event Registration and Management Plugin for WordPress
*
* @ package Event Espresso
* @ author Seth Shoultes
@joshfeck
joshfeck / 0_reuse_code.js
Created January 27, 2014 21:02
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@joshfeck
joshfeck / custom_functions.php
Created February 4, 2014 21:36
Adds an "Add to cart" link onto the single event registration page. Requires Event Espresso and its Multi Event Registration add-on.
<?php
add_action('action_hook_espresso_social_display_buttons', 'single_custom_cart_link');
function single_custom_cart_link($event_id) {
global $wpdb;
$event_name = $wpdb->get_var("SELECT event_name FROM " . EVENTS_DETAIL_TABLE . " WHERE id='" . $event_id . "'");
?><div class="custom-cart-link" style="display:block;">
@joshfeck
joshfeck / main.php
Last active August 29, 2015 13:56
update the price option correctly
<?php
if (!function_exists('espresso_ticket_information')) {
function espresso_ticket_information($atts) {
global $wpdb;
extract($atts);
$price_option = "{$price_option}";
$type = "{$type}";
@joshfeck
joshfeck / custom_functions.php
Last active August 29, 2015 13:56
use WP the_content() filter to translate a payment type.
<?php
function my_change_check( $content ) {
$content = str_replace( '<td>Check</td>', '<td>Cheque</td>', $content);
return $content;
}
<?php
function espresso_ticket_information($atts) {
global $wpdb;
extract($atts);
$price_option = "{$price_option}";
$type = "{$type}";
switch ($type) {
case 'ticket':
@joshfeck
joshfeck / po_payment_vars.php
Created February 20, 2014 16:37
This gist updates the po_payment_vars.php file found in the Event Espresso 3 PO gateway and adds some simple jQuery validation.
<?php
function espresso_display_purchase_order($payment_data) {
global $org_options;
extract($payment_data);
$default_gateway_version = empty($default_gateway_version) ? '' : $default_gateway_version;
echo '<!-- Event Espresso Purchase Order Gateway Version ' . $default_gateway_version . '-->';
$po_payment_settings = get_option('event_espresso_purchase_order_payment_settings');
<?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 );
}