Skip to content

Instantly share code, notes, and snippets.

View troutcolor's full-sized avatar

John Johnston troutcolor

View GitHub Profile
@yukulele
yukulele / jquery.wordify.js
Created January 28, 2014 14:49
wrap each word in a span
$.fn.wordify = function(){
this.find(":not(iframe,textarea)").addBack().contents().filter(function() {
return this.nodeType === 3;
}).each(function() {
var textnode = $(this);
var text = textnode.text();
text = text.replace(/([^\s-.,;:!?()[\]{}<>"]+)/g,'<span>$1</span>');
textnode.replaceWith(text);
});
return this;
@jmdodd
jmdodd / gist:1545420
Created December 31, 2011 21:36
Add post format to FeedWordPress syndicated posts
<?php
if ( ! function_exists( 'ucc_post_format_feedwordpress_syndicated_post' ) ) {
function ucc_post_format_feedwordpress_syndicated_post ( $data ) {
$feed = $data['meta']['syndication_feed'];
// Adjust stripos contents as needed.
if ( stripos( 'delicious.com', $feed ) !== false ) {
$data['tax_input']['post_format'] = 'post-format-link';
} elseif ( stripos( 'tumblr.com', $feed ) !== false ) {