Collated and paraphrased from responses on the official ThemeForest discussion thread.
Do we really have to follow the PHP coding standards outlined in the WordPress Coding Standards?
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"; | |
var Circle = function(radius) { | |
var calculateDiameter = function() { | |
return radius * 2 | |
} | |
// here's a new 'circle' | |
return { | |
radius: radius, | |
calculateDiameter: calculateDiameter | |
} |
<?php | |
# | |
# rt-theme loop | |
# | |
global $args,$content_width,$paged; | |
add_filter('excerpt_more', 'no_excerpt_more'); | |
//varialbles | |
$video_width = ($content_width =="960") ? 940 : 606; |
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 ) { |
<?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]; | |
<?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; |
<?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 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() { |
<?php | |
/* | |
* Plugin Name: Commercial Client | |
* Plugin URI: http://pento.net/ | |
* Description: A sample client plugin for showing updates for non-WordPress.org plugins | |
* Author: pento | |
* Version: 0.1 | |
* Author URI: http://pento.net/ | |
* License: GPL2+ | |
*/ |
Collated and paraphrased from responses on the official ThemeForest discussion thread.
Do we really have to follow the PHP coding standards outlined in the WordPress Coding Standards?