WPezPlugins: Theme Customize: TODO GitLab
Maintain WordPress theme customizations via a stand-alone plugin. This is the boilerplate for such a plugin.
by Mark "Chief Alchemist" Simchock for Alchemy United · gitlab.com/wpezplugins/wpez-theme-customize · website
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://gitlab.com/wpezplugins/wpez-theme-customize/-/archive/master/wpez-theme-customize-master.zipReadme
WPezThemeCustomize
Maintain WordPress theme customizations via a stand-alone plugin.
--
Special thanks to JetBrains (https://www.jetbrains.com/) and PhpStorm (https://www.jetbrains.com/phpstorm/) for their support of OSS and its devotees.
--
OVERVIEW
If you're using a child theme, imagine this plugin as a stand-alone layer that keeps "concerns" properly separated. How you configure the base (parent) theme should not be confused with how you extend it (via a child). Yes, they're related but none the less deserve to be free-standing.
If you're not using a child theme, this plugin will let you customize a theme without having to commit to a child (yet).
--
IMPORTANT
This is the boilerplate. That is, you're going to have to write some code.
--
Please Note
Be sure to update the namespace in each of the files. WPezThemeCustomize should be search & replaced with your own.
Note: Technically, this isn't necessary if you're only going to have a single instance of the plugin activated at any one time.
That said, more than one means the plugin's folder will have to be changed / customized for each version beyond the initial one.
Pardon me if this is all stating the obvious.
GETTING STARTED
Theme customizations are separated naturally into four parts:
- Actions
- Filters
- Other
- WPCore - Probably not something you're going to edit
You'll find a class for your code for each of these in their respective folders under App / Theme.
The methods you'd define in these are controlled (i.e., via hooks) in App / Theme / ClassPlugin.php. Imagine - kinda sorta - ClassPlugin as a child theme's functions.php.
As a rule of thumb, the classes under App/Theme/* define "The What". The ClassPlugin (uses those classes and) defines "The When." To make your "What" classes as reusable as possible, don't mix "The When" within "The What".
FAQ
1 - This doesn't follow the WP coding standards / naming convention?
Yup. Don't panic. That's okay. Everything is gonna be alright.
TODO
- ?
CHANGE LOG
-- 0.0.6
- ADDED - functions-plugged.php
-- 0.0.5
- CHANGED - Updated to the current version of ClassHooksRegister
- ADDED - WPezCore now has removeSettings() for removing theme options / settings (so you can hardcode those values with set_theme_mod())
-- 0.0.4
- CHANGED - restructured folder Core/RegisterHooks to Core/Hooks/Register
- CHANGED - other minor renamings etc to keep things consistent
-- 0.0.3
- ADDED - autoloader
- ADDED - ClassRegisterHooks
- CHANGED - refactored / cleaned up ClassWPCore
- CHANGED - refactored where necessary due to any of the above