Skip to content

Commit

Permalink
Update plugin root file to handle latest PluginManager API. Update PH…
Browse files Browse the repository at this point in the history
…P requirement to 7.1.
  • Loading branch information
jlambe committed Dec 4, 2018
1 parent c474481 commit baa57ea
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 27 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}
],
"require": {
"php": ">=5.6.4",
"php": ">=7.1",
"composer/installers" : "~1.2"
}
}
58 changes: 32 additions & 26 deletions plugin-name.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
/**
* Plugin Name: Plugin Name
* Plugin URI: http://www.domain.tld
* Plugin Prefix: tld_domain_plugin
* Description: Plugin description.
* Version: 1.0.0
* Author: Your name
* Author URI: https://framework.themosis.com/
* Text Domain: plugin-textdomain
* Domain Path: /languages
* Domain Var: PLUGIN_TD
* Plugin Namespace: tld_domain_plugin
*/

use Themosis\Core\Application;
Expand All @@ -27,7 +27,22 @@

/*
|--------------------------------------------------------------------------
| Plugin assets locations
| Plugin i18n | l10n
|--------------------------------------------------------------------------
|
| Registers the "languages" directory for storing the plugin translations.
| The plugin text domain constant name is the plugin "Domain Var" header
| and its value the "Text Domain" header.
*/
load_plugin_textdomain(
$plugin->getHeader('text_domain'),
false,
$plugin->getPath(trim($plugin->getHeader('domain_path'), '\/'))
);

/*
|--------------------------------------------------------------------------
| Plugin Assets Locations
|--------------------------------------------------------------------------
|
| You can define your plugin assets paths and URLs. You can add as many
Expand All @@ -40,42 +55,33 @@

/*
|--------------------------------------------------------------------------
| Plugin i18n | l10n
| Plugin Views
|--------------------------------------------------------------------------
|
| Registers the "languages" directory for storing the plugin translations.
| The plugin text domain constant name is the plugin "Domain Var" header
| and its value the "Text Domain" header.
| Register the plugin "views" directory. You can configure the list of
| view directories from the "config/prefix_plugin.php" configuration file.
*/
load_plugin_textdomain(
$plugin->getHeader('text_domain'),
false,
$plugin->getPath(trim($plugin->getHeader('domain_path'), '\/'))
);
$plugin->views($plugin->config('plugin.views', []));

/*
|--------------------------------------------------------------------------
| Plugin includes
| Plugin Service Providers
|--------------------------------------------------------------------------
|
| Auto includes files by providing one or more paths. By default, we setup
| an "inc" directory within the plugin. Use that "inc" directory to extend
| your WordPress application. Nested files are also included.
| Register the plugin "views" directory. You can configure the list of
| view directories from the "config/prefix_plugin.php" configuration file.
*/
$plugin->includes([
$plugin->getPath('inc')
]);
$plugin->providers($plugin->config('plugin.providers', []));

/*
|--------------------------------------------------------------------------
| Plugin assets
| Plugin Includes
|--------------------------------------------------------------------------
|
| Here you can define the loaded assets from our previously defined
| "dist" directory. Assets sources are located under the root "assets"
| directory and are then compiled, thanks to Laravel Mix, to the "dist"
| folder.
|
| @see https://framework.themosis.com/docs/
| @see https://laravel-mix.com/
| Auto includes files by providing one or more paths. By default, we setup
| an "inc" directory within the plugin. Use that "inc" directory to extend
| your WordPress application. Nested files are also included.
*/
$plugin->includes([
$plugin->getPath('inc')
]);

0 comments on commit baa57ea

Please sign in to comment.