norcross / control-wp-core-emails Goto Github PK
View Code? Open in Web Editor NEWFine tune the emails sent by WP core
License: MIT License
Fine tune the emails sent by WP core
License: MIT License
I'd suggest using the following pattern for initialization (AFAIR its a variation of the Singleton pattern):
class myFancyClassName {
/**
* Plugin instance.
*
* @see get_instance()
* @type object
*/
protected static $instance = NULL;
/**
* Implements Factory pattern
* Strongly inspired by WP Maintenance Mode of Frank Bueltge ^_^ (@link https://github.com/bueltge/WP-Maintenance-Mode)
*
* Access this plugins working instance
*
* @wp-hook plugins_loaded
* @return object of this class
*/
public static function get_instance() {
NULL === self::$instance and self::$instance = new self;
return self::$instance;
}
function __construct() {
}
// .. rest of the class
}
add_action('plugins_loaded', array( 'myFancyClassName', 'get_instance' ) );
Also I'd like to suggest the usage of a configuration file. As somebody else already implied, managing multiple WP installs (eg. 20+) could quickly turn into a big fat PITA. Thus adding a configuration file and extending the plugin for MU usage, would greatly improve its value ;)
My suggested scheme as follows:
Should be dropped straight into the upload directory, just like this:
https://gist.github.com/ginsterbusch/b4d84eb6256cd9373210efcca2764cdf
You'd just drop both the config file and the MU plugin into the MU directory, and be done. Could easily be automated ;)
cu, w0lf.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.