Skip to content

Instantly share code, notes, and snippets.

View jkudish's full-sized avatar

Joey Kudish jkudish

View GitHub Profile
@jkudish
jkudish / gist:1981268
Created March 5, 2012 21:37
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');
<?php
sprintf(
__('Mauris ligula est, venenatis id faucibus at, euismod vel felis. %s Lorem ipsum dolor sit amet, consectetur adipiscing elit.', 'the-events-calendar'), sprintf('<a href="http://google.com">%s</a>', __('My Link', 'the-events-calendar')
);
<?php
$args = array(
'Venue' => 'My great venue',
'Country' => 'Canada',
'Address' => '123 Fake St.',
'City' => 'Vancouver',
'Province' => 'BC',
);
$venue_id = tribe_create_venue($args);
update_post_meta($venue_id, 'ID', 'MCHS-MN-Rochester');
@jkudish
jkudish / tribe-settings.md
Created March 14, 2012 22:30
Documentation for the new TribeSettings API available in The Events Calendar 2.0.5

Tribe Settings API

This is documentation for the new TribeSettings API available in The Events Calendar 2.0.5 and up

There are four classes that make up the new Tribe Settings API. All four are located in the /lib folder of the plugin. All four are also bootstrapped and loaded whenever the plugin runs.

Take note that each class represents a level of abstraction. If you are creating a new settings tab, you will be mostly concerned and interested in the fourth class TribeSettingsTab which neatly wraps the other 3 classes into a helpful & easy to use API.

Class TribeSettings

@jkudish
jkudish / tribe-settings-example.php
Created March 27, 2012 20:28
Tribe Settings Example
<?php
add_action('tribe_settings_do_tabs', 'tribe_add_general_tab');
function tribe_general_setting_tabs() {
$generalTab = array(
'priority' => 10,
'fields' => array(
'upsell-heading' => array(
'type' => 'heading',
'label' => __('Additional Functionality', 'tribe-events-calendar'),
'conditional' => ( !defined('TRIBE_HIDE_UPSELL') || !TRIBE_HIDE_UPSELL ),
@jkudish
jkudish / optimizely.php
Created March 27, 2012 23:49 — forked from evansolomon/optimizely.php
WordPress.com plugin for running Optimizely experiments
<?php
/*
Plugin Name: Optimizely
Description: Runs Optimizely experiments.
Author: koop, evansolomon
Version: 0.2
*/
class WPCOM_Optimizely {
public $version;
@jkudish
jkudish / exclude-events-category.php
Created March 31, 2012 22:11
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
*/
@jkudish
jkudish / gist:2269675
Created March 31, 2012 23:28 — forked from andoodle/gist:2269674
mediawiki google analytics plugin
<?php
if ( !defined( 'MEDIAWIKI' ) ) {
die( 'This file is a MediaWiki extension, it is not a valid entry point' );
}
$wgExtensionCredits['other'][] = array(
'path' => __FILE__,
'name' => 'Google Analytics Integration',
'version' => '2.0.2',
'author' => 'Tim Laqua',
<?php
if ( is_page() ) {
echo 'this is a page';
} elseif ( is_single() ) {
echo 'this is a post';
echo <br>how wonderful!';
@jkudish
jkudish / tribe_ical_add_alarm.php
Created May 4, 2012 19:21
tribe_ical_add_alarm
tribe_ical_add_alarm