This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Feed Killah! | |
Plugin URI: http://digitalize.ca | |
Description: Kills feeds like a mo-fo! | |
Author: Mohammad Jangda | |
Version: 0.1 | |
Author URI: http://digitalize.ca | |
Be nice, and use sort of GPL License, okay? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Inspired by a snippet by Justin Tadlock (http://justintadlock.com/) posted here: http://elliotjaystocks.com/blog/tutorial-multiple-singlephp-templates-in-wordpress/#comment-2383 | |
add_filter( 'category_template', 'my_category_template' ); | |
// I believe *_template hooks exist for just about every type of template so it's easy to apply to other templates as well | |
function my_category_template( $template ) { | |
if( is_category( 1 ) ) // We can search for categories by ID | |
$template = locate_template( array( 'template_id_A.php', 'category.php' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// Save the hash the user loaded the page with | |
var page = (location.hash) ? location.hash : ''; | |
// When you instantiate the jQTouch object, it will revert the hash to the top div on the page or the div with class="current" | |
$jQT = new $.jQTouch({ | |
icon: 'jqtouch.png', | |
statusBar: 'black-translucent', | |
preloadImages: [ | |
'themes/jqt/img/chevron_white.png', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function filter_recipients($recipients, $post) { | |
// grab the users we want to filter | |
$author = get_userdata($post->post_author); | |
$current_user = wp_get_current_user(); | |
// Remove author and user who made the change from notification | |
$recipients = array_values( array_diff( $recipients,array($author->user_email, $current_user->user_email) ) ); // sorta hacky way to remove the element, found here: http://www.bin-co.com/php/scripts/array_remove.php | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Must be in an external file or loaded at the end of wp_footer() | |
jQuery(document).ajaxSend(function(e, x, a) { | |
var awesome = 1; | |
a.data += '&' + jQuery.param( {is_awesome: awesome} ); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In case we forget to take out console statements. IE becomes very unhappy when we forget. Let's not make IE unhappy | |
if(typeof(console) === 'undefined') { | |
var console = {} | |
console.log = console.error = console.info = console.debug = console.warn = console.trace = console.dir = console.dirxml = console.group = console.groupEnd = console.time = console.timeEnd = console.assert = console.profile = function() {}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'wp_mail_from', 'mycustom_wp_mail_from' ); | |
function mycustom_wp_mail_from( $from_email ) { | |
return '[email protected]'; | |
} | |
add_filter( 'wp_mail_from_name', 'mycustom_wp_mail_from_name' ); | |
function mycustom_wp_mail_from_name( $from_name ) { | |
return 'John Doe'; |
OlderNewer