Skip to content

Commit

Permalink
Add-on support and readme update
Browse files Browse the repository at this point in the history
New core package support, this comes with add-ons and global functions.
Readme updated.
  • Loading branch information
amostajo committed Oct 28, 2015
1 parent c14e76b commit bcae9c8
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 9 deletions.
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ The power of **Composer** and **MVC** in your **Wordpress** plugins.
- [Hooks and Filters](#hooks-and-filters)
- [MVC](#mvc)
- [Config](#config)
- [Add-ons](#add-ons)
- [Change Log](#change-log)
- [Coding Guidelines](#coding-guidelines)
- [License](#license)

Expand Down Expand Up @@ -270,7 +272,7 @@ You can add your own config variables into `config\plugin.php` and access them w

```php
// In config\plugin.php

'myapi' => array(
'key' => 'jdsldjsfl12938nfk',
),
Expand All @@ -292,10 +294,31 @@ class Main extends Plugin
}
```

### Add-ons

WPP now supports **Addons** or external **Packages** developed using WP code.

Add your add-ons at the config file, like:

```php
// In config\plugin.php

'addons' => [
'SpecialAddonNamespace\AddonClass',
'PackageAddon\AddonClass',
],
```

For more information about add-on development, click [here](https://github.com/amostajo/wordpress-plugin-core).

## Change Log

For version upgrades and change log, click [here](https://github.com/amostajo/wordpress-plugin/releases).

## Coding Guidelines

The coding is a mix between PSR-2 and Wordpress PHP guidelines.

## License

**Wordpress Plugin** is free software distributed under the terms of the MIT license.
**Wordpress Plugin** is free software distributed under the terms of the MIT license.
6 changes: 3 additions & 3 deletions boot/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
$$plugin_name = new $plugin_class( new Amostajo\WPPluginCore\Config( $config ) );

//--- INIT
$$plugin_name->init();
$$plugin_name->autoload_init();

//--- ON ADMIN
if ( is_admin() ) {

$$plugin_name->on_admin();
$$plugin_name->autoload_on_admin();

}

// Unset
unset($config);
unset($plugin_namespace);
unset($plugin_name);
unset($plugin_class);
unset($plugin_class);
10 changes: 6 additions & 4 deletions config/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
* --------------------------
*/

return array(
return [

'namespace' => 'Plugin',

'paths' => array(
'paths' => [

'controllers' => __DIR__ . '/../controllers/',
'views' => __DIR__ . '/../views/',

),
],

);
'addons' => [],

];

0 comments on commit bcae9c8

Please sign in to comment.