When you install the action scheduler inside your plugin or theme via composer installer, for example:
"require": {
"php": ">=5.6",
"composer/installers": "1.7.0",
"woocommerce/action-scheduler": "^3.1.6"
},
If you run composer install
, Action Scheduler creates a wp-content
folder inside the plugin folder. So, the path would be: wp-content/plugins/your-plugin/wp-content/plugins/action-scheduler
.
The path is certainly confusing. and end-users might think the wp-content
folder inside the plugin is duplicate and redundant.
What to do?
To change the path, you can add the installer path in composer.json
"extra": {
"installer-paths": {
"vendor/{$vendor}/{$name}/": ["woocommerce/action-scheduler"]
}
},
So, that when you run composer install, the path would be wp-content/plugins/your-plugin/vendor/woocommerce/action-scheduler
. After all, Action Scheduler is a vendor.
That’s all. Check out the basic usage of Action Scheduler.
Thank you man. You saved my time.