wplib / wplib

Foundation Library for Business-critical WordPress Websites
http://wplib.org
Other
134 stars 12 forks source link

Add a meta box component #62

Open clubdeuce opened 8 years ago

clubdeuce commented 8 years ago

Although you are not a fan, @mikeschinkel, there are many that like to add meta boxes to the post edit screens (in particular, a project I am working on right now wants custom fields in meta boxes).

I am proposing adding a WPLib_Meta_Box_Module_Base object that has the following methods:

In addition, there would be a WPLib_Meta_Box object that would support the following methods:

Discuss.

mikeschinkel commented 8 years ago

@clubdeuce How about start with a project-specific MetaBox module? That is the way that I have been thinking about how things would start before adding them to WPLib proper.


On a related note I have actually been thinking about adding a wplib/modules repo that would start out just being an index of externally published Modules for WPLib. The index would be a markdown file and possibly a JSON file if we want to try to keep them in sync. Then if someone publishes a their own module they can submit a pull request to add their module to the list.

So for example NewClarity could publish WPLib modules without them needing to be of the quality level to publish as an "official" WPLib module. And over time we could mature those publicly available modules, hopefully even taking pull requests if we can get others to start using WPLib. I think when NewClarity completes its two current projects we might have the basis for publishing numerous modules so that the code can start to have a life of its own.

I am also thinking about giving then a name: WPLib Open Library Modules (OLM) and recommending people name their repo starting with WPLib OLM:.... The idea behind an OLM would be that people can use explicit versions with Composer, but later versions make cause breakage so they would just need to be aware of this and may need to fork them if they want to add features w/o breakage. But since they come from a shared base maybe this would facilitate having them merged back into the same Module.

Then we can see which ones mature and possibly promote some of them to be actual WPLib official modules. And in some cases roll the code into WPLib itself.


So maybe a ClubDeuce_Meta_Box_Module_Base?

clubdeuce commented 8 years ago

@mikeschinkel Very good.

clubdeuce commented 8 years ago

@mikeschinkel How will people include modules using composer? If i understand the current functionality correctly, WPLIb can only handle modules in either the WPLib vendor, mu-plugin, or theme directories.

mikeschinkel commented 8 years ago

@clubdeuce Modules MUST be in either WP_CONTENT_DIR . '/{app}/modules/ or in vendor/{team}/{app}/modules/. So we would need to either map that in the Composer file or include some kind of extension. Failing that being possible we might have to add a post-install-cmd and a post-install-cmd script.