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
document.addEventListener('om.Optin.success', function(event) { | |
// This event is passed the Campaign object | |
console.log(event.detail.Campaign); | |
// This event is passed the Optin object | |
console.log(event.detail.Optin); | |
// This event is passed the success response | |
console.log(event.detail.response); | |
} ); |
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
/** | |
* An extender that syncs the observable with the address | |
* bar (using hash fragment). Will load from URL hash or | |
* querystring (at time of creation) and will | |
* update hash when observable changes. | |
* | |
* Options: string|object | |
* String: Query parameter key to get/set | |
* Object: | |
* - param - Query parameter key to get/set |
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_filter( 'tribe_events_filter_values', 'tribe_filter_event_categories', 10, 2 ); | |
function tribe_filter_event_categories( $values, $slug ) { | |
if ( $slug == 'eventcategory' ) { | |
foreach ( $values as $i => $category ) { | |
if ( $category['name'] == 'Event Category 1' ) { | |
unset ( $values[$i] ); | |
break; | |
} |
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 | |
/** | |
* This actually does the redirect. If an event was submitted, and we're about | |
* to reload the submission page (with a message instead of a form), this will | |
* redirect to the home page. | |
* | |
* @param WP $wp | |
* @return void | |
*/ |
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('init', 'tribe_allow_large_joins'); | |
function tribe_allow_large_joins(){ | |
global $wpdb; | |
$wpdb->query('SET SQL_BIG_SELECTS=1'); | |
} |
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('wp_router_generate_routes', 'tribe_set_community_template', 100, 1); | |
function tribe_set_community_template( $router ) { | |
$new_template = array( | |
'template' => array('new-template.php'), // edit this filename to be the one you want to use in your theme | |
); | |
$router->edit_route('ce-edit-venue-route', $new_template); | |
$router->edit_route('ce-edit-organizer-route', $new_template); | |
$router->edit_route('ce-edit-route', $new_template); |
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 | |
/** | |
* Generic function to add body classes | |
* Can take either a string of space-separated classes or an array | |
* | |
* Requires PHP 5.3 for access to closures | |
*/ | |
function es_add_body_class( $new_classes ) { | |
// Turn the input into an array we can loop through |