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
/** | |
* This gist demonstrates how to properly load jQuery within the context of WordPress-targeted JavaScript so that you don't | |
* have to worry about using things such as `noConflict` or creating your own reference to the jQuery function. | |
* | |
* @version 1.0 | |
*/ | |
(function( $ ) { | |
"use strict"; | |
$(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 | |
/* | |
Plugin Name: Simplecart for WordPress | |
Plugin URI: http://wp.tutsplus.com/articles/how-to-include-javascript-and-css-in-your-wordpress-themes-and-plugins/#comment-827004468 | |
Description: A very simple plugin to load SimpleCart in WordPress | |
Version: 1.0 | |
Author: Japh | |
Author URI: http://wp.tutsplus.com/author/Japh | |
License: GPL2 | |
*/ |
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 | |
/** | |
* Allows activation of plugins via WP Bulter using the "activate" keyword (ie "activate Gravity Forms") | |
* | |
*/ | |
add_filter('wp_butler_ajax_keyword_actions', 'wp_butler_switch_plugins_action'); | |
function wp_butler_switch_plugins_action($term_and_actions) { | |
list($term, $actions) = $term_and_actions; |
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_butler_ajax_keyword_actions', 'wp_butler_switch_plugins_action', 10, 2); | |
function wp_butler_switch_plugins_action($term_and_actions) { | |
list($term, $actions) = $term_and_actions; | |
$term_words = explode( ' ', $_REQUEST['term'] ); | |
$keyword = $term_words[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
protected function find_exec() { | |
exec( "type convert", $type, $type_rcode ); | |
if ( ! $type_rcode ) { | |
$convert_type = explode( ' ', $type[0] ); | |
$this->convert_bin = $convert_type[0]; | |
} else { | |
exec( "locate " . escapeshellarg( "*/convert" ), $locate, $locate_rcode ); | |
foreach ( $locate as $binary ) { |
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 | |
# | |
# rt-theme loop | |
# | |
global $args,$content_width,$paged; | |
add_filter('excerpt_more', 'no_excerpt_more'); | |
//varialbles | |
$video_width = ($content_width =="960") ? 940 : 606; |
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
var Circle = function(radius) { | |
var calculateDiameter = function() { | |
return radius * 2 | |
} | |
// here's a new 'circle' | |
return { | |
radius: radius, | |
calculateDiameter: calculateDiameter | |
} |
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 time_ago(time) { | |
periods = new Array("second", "minute", "hour", "day", "week", "month", "year", "decade"); | |
lengths = new Array("60","60","24","7","4.35","12","10"); | |
nowdate = new Date(); | |
now = (nowdate.getTime() / 1000); | |
difference = now - time; | |
tense = "ago"; | |
NewerOlder