wp-bootstrap / wp-bootstrap-navwalker

A custom WordPress nav walker class to fully implement the Twitter Bootstrap 4.0+ navigation style (v3-branch available for Bootstrap 3) in a custom theme using the WordPress built in menu manager.
https://wp-bootstrap.github.io/wp-bootstrap-navwalker/
GNU General Public License v3.0
3.37k stars 1.94k forks source link

Please set this package to use Composer Autoload #461

Open stefanobartoletti opened 4 years ago

stefanobartoletti commented 4 years ago

This package doesn't seem to work with Composer Autoload.

I've seen that a similar issue was already opened #346 but I don't seem to be able to make this work.

Right now as a workaround I had to put this in my own project's composer.json:

"autoload": {
    "files": ["vendor/wp-bootstrap/wp-bootstrap-navwalker/class-wp-bootstrap-navwalker.php"]
},

But this is not needed with other packages that I use and I would prefer it wp-bootstrap-navwalker could load itself as well.

Thank you :-)

ethanclevenger91 commented 4 years ago

I found that, at least in a Bedrock setup, using the files autoload option, the walker gets autoloaded before WordPress is loaded, which means the Walker_Nav_Menu class can't be found.