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?
<?php | |
/* | |
Plugin Name: Instrument Hooks for WordPress | |
Description: Instruments Hooks for a Page. Outputs during the Shutdown Hook. | |
Version: 0.1 | |
Author: Mike Schinkel | |
Author URI: http://mikeschinkel.com | |
*/ | |
if (isset($_GET['instrument']) && $_GET['instrument']=='hooks') { |
<?php | |
/* | |
Plugin Name: A Plugin Name | |
Plugin URI: http://somadesign.ca/ | |
Description: Be descriptive. | |
Version: 0.1 | |
Author: Soma Design | |
Author URI: http://somadesign.ca/ | |
License: GPL v2 |
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref | |
<?php | |
/** | |
* WordPress Query Comprehensive Reference | |
* Compiled by luetkemj - luetkemj.github.io | |
* | |
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters | |
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php | |
*/ |
<?php | |
add_filter("the_content", "the_content_filter"); | |
function the_content_filter($content) { | |
// array of custom shortcodes requiring the fix | |
$block = join("|",array("col","shortcode2","shortcode3")); | |
// opening tag |
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?
<?php | |
/** ADD EVERYTHING BELOW THIS LINE TO YOUR CHILD THEME'S FUNCTIONS.PHP **/ | |
function ubermenu_post_grid( $atts ){ | |
//we're going to need access to the UberMenu object for image functionality | |
global $uberMenu; | |
import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')
From here on out, use Package Control to install everything. ⌘
+Shift
+P
, then type Install
to get a list of installable packages you can 'livesearch through. After installing plugins, they should be running.
This is a WORK IN PROGRESS intended for fleshing out and feedback
It's very common for people to be unhappy with how a WordPress plugin adds front end resources to their site. If a plugin needs CSS, the plugin will add a <link>
element to that CSS. If the plugin needs JavaScript, it will add a <script>
to that JavaScript.
Plugins do this because it works. It's damn important for a WordPress plugin to work, even in adverse conditions. They rightfully want good ratings and little customer support.
But this comes at the cost of additional HTTP requests. In optimizing front end performance of a site, reducing the number of HTTP requests is a huge thing. Front end developers want to decide and control how front end resources are being handled, and WordPress plugins don't typically make this easy on them.
$key = $_SERVER['REMOTE_ADDR'] . serialize($_REQUEST); | |
if(strlen($key) < 500){ // help prevent flooding. | |
$key = md5($key); | |
// global so we can find it in the shutdown function | |
$GLOBALS['wordpress_temp_file'] = dirname(__FILE__).'/cache/wp_'.basename($key); | |
if(is_file($GLOBALS['wordpress_temp_file']) && filemtime($GLOBALS['wordpress_temp_file']) > (time() - 3600)){ | |
$data = unserialize(file_get_contents($GLOBALS['wordpress_temp_file'])); | |
echo $data['content']; | |
exit; | |
} |
/*global module:false*/ | |
/*global require:false*/ | |
/*jshint -W097*/ | |
"use strict"; | |
module.exports = function(grunt) { | |
// load all grunt tasks | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |