TypeRocket / typerocket

TypeRocket is a highly integrated MVC WordPress framework with beautiful UI components for the modern developer.
https://typerocket.com
452 stars 62 forks source link

override folders to a plugin level #251

Closed str closed 2 years ago

str commented 2 years ago

If I want to create a custom plugin, could I have "override folders" not at a theme nor root level, but at a plugin level?

What if I have multiple plugins basedon typerocket in the same wp site?

kevindees commented 2 years ago

Hey @str

This is possible by defining the overrides directory and config directory in your wp-config.php file.

$plugin_path = '/your/plugin/path';
define('TYPEROCKET_OVERRIDE_PATH', $plugin_path);
define('TYPEROCKET_CORE_CONFIG_PATH', $plugin_path . '/config');
define('TYPEROCKET_APP_ROOT_PATH', $plugin_path);
define('TYPEROCKET_ALT_PATH', $plugin_path);
define('TYPEROCKET_AUTOLOAD_APP', [
    'prefix' => TYPEROCKET_APP_NAMESPACE . '\\',
    'folder' =>  $plugin_path . '/app/',
]);

However, if you are using TypeRocket Pro there is a command you can use to quickly create a TypeRocket enabled plugin.

https://typerocket.com/docs/v5/plugins-making/

Thanks, Kevin