2017 © Pedro Peláez
 

library component-plugin

Base plugin for WordPress plugin creation

image

flexpress/component-plugin

Base plugin for WordPress plugin creation

  • Wednesday, September 3, 2014
  • by timperry
  • Repository
  • 1 Watchers
  • 1 Stars
  • 96 Installations
  • PHP
  • 7 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

FlexPress plugin component

Note there is a boilerplate framework you can use instead of trying to use this manually:, (*1)

composer create-project flexpress/plugin-framework <pluginname>

Creating a concreate class

You need to create a concreate class that extends the Abstract Plugin class:, (*2)

class MyPlugin extends AbstractPlugin
{
}

You can optionally override the init method like this:, (*3)

class MyPlugin extends AbstractPlugin
{
  public function init($file)
  {
    parent::init($file);
  }
}

This allows you to add your initalisation code for helpers like the taxonomy and post types components., (*4)

Install via pimple

Once you are all done setting up your class you need to add the config to pimple:, (*5)

$pimple['myPlugin'] = function(){
  return new MyPlugin();
};

Usage

Finally to set it up, grab it from pimple and call the init method with the current file, which should be the pluginsname.php file in the root of the plugin folder: $plugin = $pimple['myPlugin']; $plugin->init(__FILE__);, (*6)

The Versions

03/09 2014

dev-master

9999999-dev

Base plugin for WordPress plugin creation

  Sources   Download

MIT

03/09 2014

v1.0.1

1.0.1.0

Base plugin for WordPress plugin creation

  Sources   Download

MIT

26/08 2014

v1.0.0

1.0.0.0

Base plugin for WordPress plugin creation

  Sources   Download

MIT