Skip to content

Instantly share code, notes, and snippets.

View jkudish's full-sized avatar

Joey Kudish jkudish

View GitHub Profile
@jkudish
jkudish / emailshortcode.php
Created December 7, 2012 17:52 — forked from robertdall/emailshortcode.php
Email Short Code
<?php
// Hide Email from Spam Bots
function cwc_mail_shortcode( $atts , $content = null ) {
if ( ! is_email( $content ) )
return;
for ( $i = 0; $i < strlen( $content ); $i++ )
$encodedmail .= "&#" . ord( $content[$i] ) . ';';
return '<a href="' . esc_url( 'mailto:' . $encodedmail ) . '">Email</a>';
<?php
$output .= "\n<option id='{$taxonomy}-{$term->term_id}'$class value='". esc_attr( $term->name ) . "'" . selected( in_array( $term->term_id, $selected_cats ), true, false ) . disabled( empty( $args['disabled'] ), false, false ) . ' /> ' . $indent . esc_html( apply_filters('the_category', $term->name )) . '</option>';
@jkudish
jkudish / gist.css
Created June 3, 2012 22:19 — forked from tollmanz/gist.css
Add Cacheable Gists to Your WordPress Site
.gist {
color: #e4322e;
}
.gistdiv {
padding: 0;
margin: 0;
}
.gist .gist-file {
// line 205 of web.py
self.data['sortable_headers']['sorting_method] = { 'name': sorting_method_name, 'link': link, 'html_class': html_class }
<?php
add_filter( 'tribe_ical_feed_item', 'tribe_ical_add_alarm', 10, 2 );
function tribe_ical_add_alarm( $item, $eventPost ) {
$alarm = tribe_get_custom_field( 'Alarm', $eventPost->ID );
if ( !empty( $alarm ) ) {
$item[] = 'BEGIN:VALARM';
$item[] = 'TRIGGER:-PT' . (int) $alarm . "M";
$item[] = 'END:VALARM';
}
return $item;
@jkudish
jkudish / tribe_ical_add_alarm.php
Created May 4, 2012 19:21
tribe_ical_add_alarm
tribe_ical_add_alarm
<?php
if ( is_page() ) {
echo 'this is a page';
} elseif ( is_single() ) {
echo 'this is a post';
echo <br>how wonderful!';
@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',
@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 / 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;