This is a pretty popular plugin so I was just wondering if anyone has had success integrating it with the latest version of Sage?
What I’ve done:
- Required wpackagist-plugin/the-events-calendar in composer.json and added it to the installer-paths for mu-plugins.
- Got an error when I tried to run my app: Fatal error: Call to a member function add_rewrite_tag() on null in /srv/www/mysite.com/current/web/wp/wp-includes/rewrite.php on line 51
I’m guessing I have to prevent the plugin from enqueueing any scripts and then manually add each dependency to bower. I don’t know, this is hurting my head and I was hoping someone else has braved this path before.
Have you tried just using it as a normal plugin first? (not mu-plugin).
I just removed it from the installer-paths for mu-plugins and now the page loads. It’s still listed as a Must-Use Plugin in Wordpress backend, so…
Guessing that plugin has some problem being an mu-plugin then.
Am I right in that every Wordpress plugin (with external js/css dependencies) that I want to use with Sage requires me to dismantle their enqueueing and manually add the assets via bower?
No. You are not expected to use Bower for any 3rd party WordPress plugins.
It’s suggested if you want to cut down on the amount of extra CSS and JS files being loaded to dequeue the plugin’s files and then add them to the Sage build process. But again, it’s not required. And I don’t think anyone has incorporated a plugin’s dependencies with Bower. That sounds like a bit of a headache.
Bower in Sage is made for the theme and any of it’s front-end dependencies. To that same effect, I tend to only use plugins that add functionality, not front-end assets. For something like Gravity Forms, I disable the CSS and style the forms myself.
The following site is a project I built with ECP and their WooTickets extension running a very recent version of Sage and using it as a normal plugin.