Skip to content

Instantly share code, notes, and snippets.

View jo-snips's full-sized avatar

Jonah West jo-snips

View GitHub Profile
@jo-snips
jo-snips / featured-image-link.php
Created March 9, 2012 01:42 — forked from jonahcoyote/featured-image-link.php
The Events Calendar: Wrap post thumbnail in custom field link
@jo-snips
jo-snips / logged-in-events.php
Created March 9, 2012 02:41 — forked from jkudish/logged-in-events.php
The Events Calendar: Prevent non logged in users from seeing The Events Calendar
<?php
/*
Plugin Name: Logged in only events calendar
Plugin URI: http://tri.be/support/forums/topic/calendar-view/#post-14059
Description: Prevents non-loggedin users from seing The Events Calendar. Requires The Events Calendar by Modern Tribe Inc
Version: 0.1
Author: Joachim Kudish
Author URI: http://jkudish.com/
License: GPLv2
@jo-snips
jo-snips / gist:2004704
Created March 9, 2012 02:42 — forked from jkudish/gist:1981268
The Events Calendar: filtering years in The Events Calendar year dropdown - this will only work in 2.1+
<?php
// filter the number of years to go back
add_filter('tribe_years_to_go_back', 'my_tribe_years_to_go_back');
function my_tribe_years_to_go_back() {
return 2;
}
// filter the number of years to go forwards
add_filter('tribe_years_to_go_forward', 'tribe_years_to_go_forward');
@jo-snips
jo-snips / change-number-years.php
Created March 9, 2012 02:42 — forked from jkudish/change-number-years.php
The Events Calendar: change the number of years in the dropdown for The Events Calendar
<?php
/**
* this is lines 563-573 of /lib/tribe-view-helpers.class.php
*/
private static function years( ) {
$year = ( int )date_i18n( 'Y' );
// Back two years, forward 5
$year_list = array( $year - 1, $year, $year + 1, $year + 2, $year + 3, $year + 4, $year + 5 );
@jo-snips
jo-snips / no-index-single-tribe-events.php
Created March 9, 2012 02:42 — forked from jkudish/no-index-single-tribe-events.php
The Events Calendar: noindex single tribe_events
<?php
add_action('wp_head','tribe_dont_index_single_events');
function tribe_dont_index_single_events() {
if ( is_singular() && get_post_type() == TribeEvents::POSTTYPE )
echo '<meta name="robots" content="noindex">';
}
@jo-snips
jo-snips / single-no-pagination.php
Created March 9, 2012 02:43 — forked from jkudish/single-no-pagination.php
The Events Calendar: show all events on a single day view
<?php
add_filter('pre_get_posts', 'tribe_filter_days_on_single_day', 20);
function tribe_filter_days_on_single_day($query) {
if (tribe_is_day()) {
$query->set('nopaging', true);
}
return $query;
}
@jo-snips
jo-snips / page-random-event.php
Created March 9, 2012 02:44 — forked from jkudish/page-random-event.php
The Events Calendar: This is an example of a query which gets a single random event from the 'featured' event category amongst events from The Events Calendar
<?php
/**
* This is an example of a query which gets a single random event from the
* 'featured' event category amongsts evetns from The Events Calendar
*
* @see http://tri.be/support/forums/topic/random-featured-event-custom-widget/
*/
get_header();
@jo-snips
jo-snips / gist:2026901
Created March 13, 2012 05:00 — forked from luetkemj/wp-query-ref.php
WordPress: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@jo-snips
jo-snips / exclude-events-category.php
Last active October 2, 2015 15:38 — forked from jkudish/exclude-events-category.php
Exclude a specific category from Events Grid View
<?php
/**
* Exclude a specific category from Events Grid View
*
* @author jkudish
* @uses pre_get_posts filter
* @param object $query the query object
* @return object $query the filtered object
*/
@jo-snips
jo-snips / gist:2422022
Created April 19, 2012 16:09 — forked from markoheijnen/gist:2399864
Change Post to News
<?php
add_action( 'init', array( &$this, 'change_post_object_label' ), 0 );
add_action( 'admin_menu', array( &$this, 'change_post_menu_label' ), 0 );
add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages') );
function change_post_menu_label() {
global $menu;
global $submenu;
if( isset( $menu[5], $submenu['edit.php'] ) ) {