htmlburger / carbon-fields

WordPress Custom Fields Library ✨
https://carbonfields.net/
Other
1.37k stars 245 forks source link

[bug] - WordPress subdirectory #4

Closed nlemoine closed 8 years ago

nlemoine commented 8 years ago

Hi!

Great project! It seems to gather everything that I ever wanted.

Playing around with it, I'm experiencing a bug with the stack I'm using and which is quite popular among WordPress developers. Carbon Fields can't load any assets when WordPress is in a subdirectory (see https://github.com/roots/bedrock, https://github.com/wecodemore/wpstarter, https://github.com/bueltge/WordPress-Starter, there are many more). The plugin/package URL only works when using WordPress in a traditional way, if used in a subdirectory, the URL guessing/defining code returns a wrong URL (returns directory instead of url). https://github.com/htmlburger/carbon-fields/blob/master/carbon-fields.php#L11

Maybe you could take advantage of the method used in ACF to guess the right URL: https://github.com/elliotcondon/acf/blob/master/acf.php#L115

Let me know if I can help.

tyxla commented 8 years ago

Hi @nlemoine,

Thanks for reporting, and for conducting the detailed research - it was very helpful.

There was a quick fix to that, although it was a manual one - it is documented here: https://wordpress.org/support/topic/container-displays-no-fields-in-backend

However, now we've implemented a better way of guessing the root URL, inspired by the ACF method of doing it. You can see it here: https://github.com/htmlburger/carbon-fields/commit/326b3733ac513542e70094a53801cf4e3164547a.

Please, let us know if you're having further issues.

nlemoine commented 8 years ago

Thanks for the quick fix!

There was a quick fix to that, although it was a manual one - it is documented here: https://wordpress.org/support/topic/container-displays-no-fields-in-backend

Sorry, I didn't see this topic, I usually stay away from WordPress forums :)

I'll probably post some other issues or improvments I see from the plugin tour I'm doing.

tyxla commented 8 years ago

Glad it worked for you!

Also, we really appreciate any ideas for improvements or bug reports - so thanks in advance for posting any.