Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonah West jo-snips

View GitHub Profile
View tribe-admin-events-list.class.php
<?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)
*/
@jo-snips
jo-snips / body-classes.php
Created Nov 14, 2013
WordPress - Dynamic Browser Body Classes
View body-classes.php
/*-----------------------------------------------------------------------------------*/
/* 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;
}
View functions.php
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;
View gist:7103127

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
View community-datepicker.js
// 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);
@jo-snips
jo-snips / font-awesome-plain-text.txt
Last active Jul 23, 2016
Font Awesome Plain Text List
View font-awesome-plain-text.txt
adjust
adn
align-center
align-justify
align-left
align-right
ambulance
anchor
android
angle-down
@jo-snips
jo-snips / filter_query_arg.php
Created Jul 16, 2013
The Events Calendar - Filter Query Args For Genesis Responsive Slider
View filter_query_arg.php
<?php
add_filter('genesis_responsive_slider_query_args', 'custom_genesis_responsive_slider_query_args');
function custom_genesis_responsive_slider_query_args($query_args) {
$term_args = array( );
if ( 'page' != genesis_get_responsive_slider_option( 'post_type' ) ) {
if ( genesis_get_responsive_slider_option( 'posts_term' ) ) {
@jo-snips
jo-snips / filter_website_link.php
Created Jul 15, 2013
The Events Calendar - Filter Website Link
View filter_website_link.php
View gist:6004270
<?php
add_action( 'init', 'tribe_events_wootheme_compatibility' );
function tribe_events_wootheme_compatibility() {
if ( ! is_home() ) {
remove_filter( 'pre_get_posts', 'woo_exclude_categories_homepage', 10 );
}
}
@jo-snips
jo-snips / fix_page_not_found_title.php
Created Jul 9, 2013
The Events Calendar - Fix Page Not Found Title
View fix_page_not_found_title.php
<?php
add_action('template_include', 'avoid_404_event_titles', 1);
function avoid_404_event_titles() {
global $wp_query;
if (property_exists($wp_query, 'tribe_is_event') && $wp_query->tribe_is_event and $wp_query->is_404)
$wp_query->is_404 = false;
}
You can’t perform that action at this time.