Date post: | 17-Jul-2015 |
Category: |
Technology |
Upload: | mikel-king |
View: | 68 times |
Download: | 0 times |
Unlock the power of
WordPress
Using mu-plugins
By Mikel King
Mu-plugins
● Require manual installation
● Activate automatically
● Are persistent
● Do not work in subdirectories like regular plugins*
● Should not alter the DB schema**
Mu-plugins
● Require manual installation
● Activate automatically
● Are persistent
● Do not work in subdirectories like regular plugins*
● Generally should not alter the DB schema**
* There are methods and mu-plugin managers to help use regular plugins as mu’s
Mu-plugins
● Require manual installation
● Activate automatically
● Are persistent
● Do not work in subdirectories like regular plugins*
● Generally should not alter the DB schema**
* There are methods and mu-plugin managers to help use regular plugins as mu’s
** This is a use at your own risk kind of situation
Goals...
● Familiarize you with mu-plugins
● Expose you to a new tool
● Expand your horizons
Why use mu-plugins?
Why use mu-plugins?
● They grant you abilities that other systems of
modification do not (dropins, themes, plugins)
● They grant you abilities that other do not (dropins, themes, plugins)
● The persistence model can be used to your
advantage (library code, api’s etc...)
Why use mu-plugins?
Let’s look at an example
Theme augmentation
News Magazine Theme
Theme augmentation
News Magazine Theme
Side by side comparison
Let’s look at some code!!!
https://github.com/mikelking/singleton_base
000-singleton-base.php
010-base-plugin.php
tabular-css/plugin.php
Tabular-css tree
tabular-data.css
Let’s take a deeper look at some code!!!
https://github.com/mikelking/singleton_base
000-singleton-base.php
010-base-plugin.php
So what’s the point?
● Can’t I just add the css to the main style sheet?
So what’s the point?
● Can’t I just add the css to the main style sheet?
● Or put it in it’s own file and @import it?
So what’s the point?
● Can’t I just add the css to the main style sheet?
● Or put it in it’s own file and @import it?
● Or enqueue it through function.php?
So what’s the point?
● Can’t I just add the css to the main style sheet?
● Or put it in it’s own file and @import it?
● Or enqueue it through function.php?
● Really I’m having trouble connecting the dots, man.
Well the point is that:
None of those methods are future proof.
You are responsible for reimplemention after EVERY
update.
None of those methods are easy to troubleshoot.
A plugin built like this can be turned off
Hey man this is just a high level example.
Actually this is a real world example.
Unlock the power of
WordPress
Using mu-plugins
By Mikel King
This has been:
Contact info:
https://twitter.com/mikelking
https://www.linkedin.com/in/mikelking
https://github.com/mikelking