-
Notifications
You must be signed in to change notification settings - Fork 42
Conversation
Reviewing your PR here this week, thanks for all of your love and effort on this! |
PR reviewed, I meant reviewing the text of your PR here :) |
@sc0ttkclark I'm a bit unclear---do you think my suggestion is the way to go, or will you be looking into it? As an aside, I'm having a bit of a difficult time figuring out how to test my "inclusion" code. Suggestions welcome. |
Oh, I'm going to set aside some time this week to read your suggestion here in depth is what I was saying. Will get back to you on the test. |
Looks pretty good, I think I'd like to work with you on the initial class, there's a lot we need to pair down in there and restart somewhat. |
Plugin bootstrap should now be all encapsulated in a class. If we commit to decrementing Action items added to pull request description. |
Re: CMB2 loader, this tool makes it easy to generate a similar loader: http://jtsternberg.github.io/wp-lib-loader/ |
Per discussion in #core-fields Slack, next steps: TODO in description and:
With that done, this should be a robust (if highly experimental) plugin for potential implementation testing. |
I took some time to think about this again, and I think I'm stuck with a couple of problems:
I figured it was time to reach back out to the community, instead of worrying about it and not being productive in the process 😄 . I'd like to help however I can, but this is definitely an area of testing I'm a bit lost in. Thoughts? |
Any thoughts on this? |
I would hold on this until our next dev meeting, I'm waiting to get the details finalized on that. |
Do not merge; opened for discussion
Goal
Bring the Fields API into production by making it easy to write plugins that use it; replacement of core fields can come later.
Proposal
The best solution seems to be making this a Composer plugin, intended to be bundled with a plugin that uses it, installed as its own plugin, or installed as a must-use plugin.
It is possible, albeit confusing, to support all of these at once, to some degree. The biggest problem is dependency hell, which we can mitigate. WP-SCP Framework and CMB2 are both written to automatically include only the latest version if multiple copies are installed; with a relatively simple addition we can also generate warning messages admin-side if conflicting versions exist.
Practically, we would:
This change will also make replacing core forms optional, since that is the most brittle and experimental part of this project.
Pitfalls
There are some potential downsides, though, hence the discussion pull request:
if( ! class_exists() )
)The relevant discussions I saw, like dependency hell and WP core dev unhappiness (also see Justin Sternberg's musings about this and an issue on including frameworks that he linked), though all over a year old, indicate that including frameworks (like this) in plugin code is frowned upon. However, this "framework" is plotting for core inclusion. As far as I can tell, we can craft a bootstrap process that behaves nicely and defers to any eventual core implementation.
Alternatives
is_plugin_active
or something) and warn if our plugin is not installedFinal thoughts
Unfortunately, this is the best suggestion I could come up with; I spent a while thinking about implementation and I'm pretty sure we can have a nice UX for dependency hell.
I'd love any thoughts on this; any suggestions?
Action items
define
s to class/instance variableswp-admin/
) form replacement optional