Skip to content

Instantly share code, notes, and snippets.

View jonahcoyote's full-sized avatar

Jonah C West jonahcoyote

View GitHub Profile
@jonahcoyote
jonahcoyote / events-conditional-wrappers.php
Last active October 6, 2015 12:18 — forked from ooobo/events-conditional-wrappers.php
The Events Calendar: Basic Conditional Wrappers
if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page
} elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages
} elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List
} elseif( tribe_is_event() && is_single() ) { // Single Events
} elseif( tribe_is_day() ) { // Single Event Days
<?php
/**
* Export WordPress post data to CSV
* Based on <http://stackoverflow.com/a/3474698> and <http://ran.ge/2009/10/27/howto-create-stream-csv-php/>
*/
/**
*********************************************************************
* Configuration
*********************************************************************
<?php
/**
* update ~line 26 to include 2 argument params as such:
*/
add_filter( 'posts_orderby', array( __CLASS__, 'events_search_orderby' ), 10, 2 );
/**
* update static function `events_search_orderby` (replace with the following method starting at ~line 159)
*/
@jonahcoyote
jonahcoyote / body-classes.php
Created February 22, 2016 17:47 — forked from jo-snips/body-classes.php
WordPress - Dynamic Browser Body Classes
/*-----------------------------------------------------------------------------------*/
/* Adds new body classes
/*-----------------------------------------------------------------------------------*/
add_filter('body_class', 'add_browser_classes');
function add_browser_classes($classes){
if(is_singular()) {
global $post;
$classes[] = $post->post_name;
}
add_filter( 'woocommerce_product_tabs', 'woo_remove_product_tabs', 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs['description'] ); // Remove the description tab
unset( $tabs['reviews'] ); // Remove the reviews tab
unset( $tabs['additional_information'] ); // Remove the additional information tab
return $tabs;
// Customize Events Community Datepicker
if($("div.tribe-community-events-date input.datepicker").length) {
var datepickerOpts = {
dateFormat: 'yy-mm-dd',
changeMonth: true,
changeYear: true,
onSelect: function(selectedDate) {
var option = this.id == "EventStartDate" ? "minDate" : "maxDate";
var instance = $(this).data("datepicker");
var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
@jonahcoyote
jonahcoyote / mp_custom_account_nav.php
Created April 9, 2016 01:39 — forked from supercleanse/mp_custom_account_nav.php
Add custom tabs to the MemberPress Account Page
<?php
add_action('mepr_account_nav', 'custom_account_nav', 10, 1);
function custom_account_nav($user) {
$mepr_options = MeprOptions::fetch();
$whaa_url = $mepr_options->account_page_url('action=whaa');
?>
<span class="mepr-nav-item custom-whaa">
<a href="<?php echo $whaa_url; ?>" id="mepr-account-whaa"><?php _e('Whaa', 'memberpress'); ?></a>
</span>
@jonahcoyote
jonahcoyote / tribe-event-list-target-today.php
Created December 5, 2017 23:59 — forked from jesseeproductions/tribe-event-list-target-today.php
The Events Calendar - Target a Specific Event List Widget to Only Show Todays Events
/**
* The Events Calendar - Target a Specific Event List Widget to Only Show Todays Events
*
* modify tribe-events-adv-list-widget-2 to id of widget
*/
function tribe_modify_list_widget_args_for_today( $args ) {
$start_date_init = date ( 'Y-m-d' );
$start_date_end = $start_date_init . ' 23:59:59';
@jonahcoyote
jonahcoyote / unenqueue-default-tribe-photojs-and-isotope.php
Last active April 9, 2018 17:07 — forked from barryhughes/temp-fix-ecp-embedded-photo-view-avada.php
Remove Default Tribe Photo View JS & Isotope in Shortcode #tribe #ecp
<?php
/**
* Unenqueue Tribe Scripts and replace with custom ones
*
* Tested with Events Calendar PRO 4.4.22
*/
// Unload isotope and photo view js for shortcode
add_action( 'tribe_events_pro_tribe_events_shortcode_prepare_photo', function() {
// Dequeue ECP's copy of isotope
@jonahcoyote
jonahcoyote / gw-gravity-forms-advanced-conditional-logic.php
Last active February 21, 2019 13:14 — forked from spivurno/gw-gravity-forms-advanced-conditional-logic.php
Gravity Wiz // Gravity Forms // Advanced Conditional Logic
<?php
/**
* Gravity Wiz // Gravity Forms // Advanced Conditional Logic
*
* PLEASE NOTE: This snippet is a proof-of-concept. It is not supported and we have no plans to improve it.
*
* Allows multiple groups of conditional logic per field.
*
* @version 0.1
* @author David Smith <david@gravitywiz.com>