Per Søderlind

I code for fun

Plugin Customizer: Ad WordPress customizer to a plugin

Plugin Customizer

tl;dr –  The commented demo plugin is available at GitHub.

Read More

Resetting the Customizer in your WordPress Theme to a blank slate

Thanks to Weston Router at XWP, removing all the default WordPress customizer entries is easy using the Customizer Blank Slate plugin. The only caveat is that it must be loaded as a plugin. So what do you do if you want to use it in a theme? You add Customizer Blank Slate to mu-plugins.

So what do you do if you want to use it in a theme? You add Customizer Blank Slate to mu-plugins.

1) Download Customizer Blank Slate, extract the zip and copy the files to the wp-content/mu-plugins folder.

Launch the Customizer and you’ll see that the default entries are still there. To trigger the Customizer Blank Slate you have to append customizer_blank_slate=on to the customizer.php url.

2) You do that by adding the following to your (child)theme functions.php

3) When adding your own customizer entries you have to add them using the wp_loaded hook with a priority  set to 9:

 

My plugins are tested and found compatible with WordPress 4.7

Read More

An SVG logo Custom Control for the WordPress Customizer

svg-logo

Another proof of concept.

Read More

WP Gears and the Heartbeat API

Testing WP Gears and the Heartbeat API, WP Gears is at https://github.com/10up/WP-Gears. NOTE: this plugin is run continuously, triggered by ‘plugins_loaded’, you should use an event triggered by the user (onclick, onhover etc))

Read More

WordPress linting using Code Climate, the Swiss Army knife of code linting

 

codeclimate-wordpress

tl;dr –  Code Climate is a very easy to implement linter for PHP, JavaScript, CSS etc.

Read More

Page 1 of 34

Powered by WordPress & Theme by Anders Norén