Year: 2014
-
___ without a plugin
How do I do ___ without a plugin? The answer is to remove the comment at the top of the plugin, and it’s no longer a plugin.
-
Automatticians For The People
We felt there was a major deficiency in the worldwide supply of Automatticians, and came up with a solution.
-
Admin Colour Schemes
I’ve built two Admin Colour schemes for WordPress. Both are based initially off of the themergency theme generator, but with extensive changes. Notably the split colours of the admin menu and the admin bar. I’ve also accounted for form highlights, selection, checkboxes, and the progress bar on videos. The first is called Tangerine: The second…
-
Gitbooks & GitHub
I started writing a book on gitbook.io recently, and chose to use GitHub to host it. I ran into some stumbling blocks as I started, mainly because things weren’t documented well enough, so I’m going to explain how to begin. Setting Up First, create an empty repository on GitHub to store your book. You’ll then…
-
Theme Composition vs Frameworks
For a long time, theme frameworks have been the primary alternative to building things from scratch in WordPress, and to a lesser extent, starter themes. There is a better way. Starter Themes & Frameworks Starter themes work on the paradigm of adding and replacing. You’re given a theme that represents the ‘halfway’ mark and add…
-
WordPress Bash Magic
I’ve been doing a lot of bash scripting with WordPress, especially with WP CLI. Here are some snippets I found useful. All my scripts assume a standard wp-config.php with DEFINE() statements and no unusual logic structures. A rogue constant with the name DB_NAME may throw things off without some modification. Getting the Database table prefix If you…
-
Calling Constructors
Take a look at this code, found inside the Jetpack Post Views plugin: function Jetpack_Post_Views() { $this->__construct(); } Here an object is calling its own constructor. But what’s wrong with it? The General rule for calling __construct: The only occasion it is okay to call a constructor method directly, is in a child class that…
-
Use of mysql_connect in WordPress
-
&$this
Take a look at this code, found inside a PHP class or object: add_action( &$this, ‘functionname’ ); This looks familiar, and can be found in many themes and plugins. But what’s wrong with it? It’s PHP4 code in a PHP5 world. General PHP rule for add_action: When creating a callable, never use &$this, use $this instead…