Download the PHP package orkan/wp-base without Composer
On this page you can find all versions of the php package orkan/wp-base. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download orkan/wp-base
More information about orkan/wp-base
Files in orkan/wp-base
Package wp-base
Short Description Wordpress plugin: WP Base
License MIT
Homepage https://github.com/orkan/wp-base
Informations about the package wp-base
WordPress plugin boilerplate v3.0.0
Extendable PHP classes for easy customization.
Out-of-the-box:
- Dashboard: Settings and Tools pages (unlimited)
- Custom DB cache
- Ajax requests support
- Custom admin Notices and Transients
- CSS/JS assets: combine from partials, build, minify & enqueue
Introduction:
This package was made to provide a foundation to create your own WordPress plugin with a basic functionality already implemented, like the Settings page or DB cache supprort.
This package will install in Composer [vendor] dir, making it inaccessible from WordPress installation. You must create your own folder in WP [plugins] dir and extend only those classes you will need in your project. A working example of such plugin can be found here: Base1
Create plugin:
Create your plugin entry point file [WP]/wp-content/plugins/[your_plugin]/plugin.php
then run()
only the necessary parts:
Tools:
The Base1 package comes with some example Tools and their CSS/JS assets (/assets
dir) and FORM input definitions ( /config
dir). The included Tools are:
Links to these Tools will be automatically displayed in the: Dashboard > Plugins > My Plugin - meta row.
CSS/JS assets:
The example CSS/JS assets are pre-build and minified, but you can modify them and re-build on each page refresh by adding these constants to wp-config.php
file:
Another way to rebuild assets is by using a Composer script command: composer run rebuildOrkWpBaseAssets
described in next section.
Composer:
Composer is required to install this plugin and all its dependencies and also to support autoloading class files. This README assumes following directory structure in your Composer/WordPress installation:
Add composer autoloader to wp-config.php
file:
Turn your plugin into Composer package by adding these lines in your plugin's composer.json
file:
To properly install WP plugins from Composer repositories add these lines to your root composer.json
file:
If you decide to build your assets automatically by using Composer scripts feature eg. on every "dump autoload", you can use the included method Orkan\\WP\\Base\\Utils\\Composer::rebuildAssets
Now you can also manually rebuild assets by running this command: composer run rebuildMyPluginAssets
Requirements:
- PHP ^7
- Composer ^2
- WordPress ^6
License:
Author
Updated
Sun, 26 May 2024 17:31:07 +02:00