Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support autoload.php from WP root #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chellman
Copy link

I've worked around this issue (originally mentioned here) in other ways, and assumed based on previous discussions that I must have something misconfigured or am doing something wrong. But I've just spun up a new site with Carbon Fields, everything in standard locations, and I'm convinced that I might not be the only one, and should submit a PR.

Here's the problem: I'm using CF as a plugin, installed with composer as it's supposed to be. The directory structure is standard WP, with these relevant pieces:

/wp-content/plugins/carbon-fields-plugin
/wp-content/plugins/my-custom-plugin
/vendor/autoload.php
/composer.json

There's nowhere else in the codebase attempting to load the autoload.php file, because CF is currently the only composer-installed piece. The CF plugin is supposed to fill that need as I understand it, but it only checks for the autoload file in its own directory via DIR, which doesn't working here. So I've added a conditional to look for the vendor/autoload file in the WordPress root, which seems like a reasonable fallback to include.

Am I missing something about the way composer should be working that this is a bad choice?

@nasyrov
Copy link

nasyrov commented Jan 2, 2019

Hi @chellman,

You project composer autloader should be included in wp-config.php.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants