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: Junction fixes for plugins | |
Plugin URI: http://interconnectit.com/ | |
Description: Junctioning files into the WordPess plug-ins folder causes problems with php 5.3 for plugin_url, this tries to fix it. Place in the wp-content/mu-plugins folder so it loads before all other plugins. | |
Author: James R Whitehead | |
Version: 0.0.0.0.0.0.2 | |
Author URI: http://interconnectit.com | |
*/ |
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
function getWPVersion(url){ | |
var newurl = url + "/readme.html"; | |
var hdoc = null; | |
try{ | |
hdoc = UrlFetchApp.fetch(newurl); | |
if(hdoc.getResponseCode() != 200){ | |
return "Cannot retrieve version"; | |
} | |
}catch(e){ | |
return "Cannot retrieve version"; |
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
add_filter("mce_external_plugins", "tomjn_mce_external_plugins"); | |
function tomjn_mce_external_plugins($plugin_array){ | |
$plugin_array['typekit'] = get_template_directory_uri().'/typekit.tinymce.js'; | |
return $plugin_array; | |
} |
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
class Example { | |
public function length(){ | |
return 5; | |
} | |
public function __call($name,$arguments){ | |
$methods = get_class_methods($this); | |
$ldist = 9999; | |
$currmethod = $name; | |
foreach($methods as $m){ | |
$distance = levenshtein($name,$m); |
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: Notify on Attachment Creation | |
Plugin URI: http://www.tomjn.com | |
Description: Send a notification when an attachment is created | |
Version: 1.04 | |
Author: Tom J Nowell | |
Author URI: http://www.tomjn.com | |
*/ |
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
require 'PHP-Browser/browser.class.php'; | |
function get_sellwire_csv( $username, $password, $project_id ) { | |
$browser = new Browser( 'SellWire Browser' ); | |
$browser->navigate( 'http://app.sellwire.net/logout' ); | |
$browser->navigate( 'http://app.sellwire.net/login' ); | |
$form = $browser->getForm( '//form[@method]' ); | |
$form->setAction( 'http://app.sellwire.net/login' ); | |
$form->setAttributeByName( 'username', $username )->setAttributeByName( 'password', $password ); |
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
global $wp_version; | |
if ( version_compare( $wp_version, '3.5', 'ge' ) ) { | |
if ( !function_exists( 'ucc_oembed_twitter_lang' ) ) { | |
function ucc_oembed_twitter_lang( $provider, $url, $args ) { | |
if ( stripos( $url, 'twitter.com' ) ) { | |
if ( defined( 'WPLANG' ) ) | |
$lang = strtolower( WPLANG ); | |
if ( empty( $lang ) ) | |
$lang = 'en'; |
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_action( 'loop_start', 'qd_loop_start' ); | |
add_action( 'loop_end', 'qd_loop_end' ); | |
function qd_loop_start( $query ) { | |
global $query_depth; | |
if(!isset($query_depth)){ | |
$query_depth = 0; | |
} |
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
<audio controls> | |
<source src="<?php echo wp_get_attachment_url(); ?>" type="<?php echo get_post_mime_type(); ?>"> | |
Your browser does not support the audio tag. | |
</audio> |
OlderNewer