aerdes/acorn

Laravel-based framework for WordPress plugins

v0.4.0 2020-06-09 21:44 UTC

This package is auto-updated.

Last update: 2024-10-10 07:18:43 UTC


README

Acorn is a Laravel-based framework for WordPress plugins. Actually it is not a framework yet but just a collection of helper functions...

Inspiration originated from the promising Acorn project created by the Roots team which unfortunately is still in early development at the time of coding this framework (and which was missing some desperately needed features).

To get started make sure to define the following global variables (e.g. in the wp_config.php) which are needed for the booting the functionalities. The database is further assumed to have an utf8 charset and utf8_unicode_ci collation without prefixes.

  • DB_ELOQUENT: The name of the database used
  • DB_USER: MySQL database username
  • DB_PASSWORD: MySQL database password
  • DB_HOST: MySQL hostname
  • WP_LANG: The locale used for e.g. validation features

Then install this composer package in your plugin directory at wp-content/plugins/plugin-name. Also copy the resouces and storage directories from this composer package to your plugin directory.

Finally initialize the framework in your main plugin file at wp-content/plugins/plugin-name/plugin-name.php by autoloading everything (via require_once(__DIR__ . '/vendor/autoload.php');).