Download the PHP package wpsmith/mupluginmanager without Composer
On this page you can find all versions of the php package wpsmith/mupluginmanager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wpsmith/mupluginmanager
More information about wpsmith/mupluginmanager
Files in wpsmith/mupluginmanager
Package mupluginmanager
Short Description Manages the auto-installation of a mu-plugin for a plugin.
License GPL-2.0+
Homepage https://github.com/wpsmith/MuPluginManager
Informations about the package mupluginmanager
MuPluginManager
A class to use in your WordPress plugin to install a MU Plugin auto-magically.
Description
This class takes a file and installs the file in the /mu-plugins/
folder. If the file already exists, it will compare the versions of the file
Installation
This isn't a WordPress plugin on its own, so the usual instructions don't apply. Instead you can install manually or using composer
.
Manually install class
Copy MuPluginManager/src
folder into your plugin for basic usage. Be sure to require the various files accordingly.
or:
Install class via Composer
- Tell Composer to install this class as a dependency:
composer require wpsmith/mupluginmanager
- Recommended: Install the Mozart package:
composer require coenjacobs/mozart --dev
and configure it. - The class then renamed to use your own prefix to prevent collisions with other plugins bundling this class.
Implementation & Usage
Consider this basic plugin structure with the mu-plugin in its own folder for namespacing purposes:
So then you can implement it like this:
Now, for whatever reason, you want to check for the MU plugin on more than just activation or deactivation, the class can run automagically on plugins admin page. `
Change Log
See the change log.
License
GPL 2.0 or later.
Contributions
Contributions are welcome - fork, fix and send pull requests against the master
branch please.
Credits
Built by Travis Smith
Copyright 2013-2020 Travis Smith