Closed mrgrain closed 6 years ago
Update: My initial idea was to simply put bootstrap-for-theme.php
into composer's autoload section. Whereas this would work for a theme that bundles the plugin and is published to wordpress.org, it will break any other use of the package as the bootstrap file depends on WordPress functionality. I keep digging.
More insights: The issue arises because of the nature of the current static class creation method: WPPluginToolkitPlugin::create('WPLess', __FILE__, 'WPLessPlugin');
- it depends on knowing the path to the plugin. This is perfectly fine for many cases, but will break the workflow if you are using a boilerplate like Bedrock when the package will end up in some vendor directory the including theme doesn't know about.
I created a simple wrapper class removing the dependency on the path. Let's discuss in the PR #103
bootstrap-for-theme.php
is intended for bundling the plugin with a theme (in a way that prevents multiple loading when the plugin is already present.To fix the workflow for a theme bundling this plugin, we should support for composer's autload.
I'll create a PR to address this issue.