Frameworks for WordPress

It’s been two months since I started working with WordPress and there is a thing I haven’t found yet: tools by developers for developers; and more precisely libraries (abstractions on top of WP). There is a nice exception that it’s good as an example of what I’m looking for: Carbon Fields. So, you want to create some nice custom fields, OK, just write some code. No UI on the admin page. (Oh, Timber also looks very good).

I can think of at least two more areas where having libraries could be cool:

  • Forms. There are lot’s of plugins but all of them are UI based. Maybe it would be interesting to create layer on top Symfony Forms Component; create some forms via code, customize presentation (give some nice defaults for Bootstrap & Foundation), create pipelines to decide what to do with the form data (send it via email? store it on a CPT? integrate with third party API?…).
  • CPT, taxonomies… create the post type, define columns for the list view, give some column presets (taxonomies, boolean…)…

And once you imagine few components… maybe there is any framework that integrates everything? Something that helps build on top of WP. (I don’t count Sage here as all the code is on the theme instead of in a library)

Any thoughts? Is there any framework (not in the WP theme frameworks sense)? If you have thought about it is there any reason not to go this way? Is it just to much work for the gains? Do you use coder friendly libraries? Which ones?

Bye!

4 Likes

Carbon Fields looks pretty nice - might try that out as an alternative to ACF on an upcoming project…

For forms, I just found this on GitHub. Can’t vouch for how good it is, but looks like a barebones API with no drag-and-drop UI. Appears you’d have to create custom shortcodes to make it accessible from WP Admin for non-dev users. WP Forms

I can see these types of tools being useful, and certainly an integration of a few of them would be lovely too! Maybe if people find more, we could package them together.

If you use Sublime Text, there are a ton of plugins that help with development, providing quick access to the WP Codex, or snippets, toggle debut, edit wp-config.php, etc. I’d bet there’s a number for Atom too, if you use that.

You might check out some of the WebDevStudios stuff.

CMB2 as an ACF alternative. CPT Core for generating CPT’s. I’ve used their Yeoman plugin generator as well, it has some cool sub-generators attached.

Take a look through heir GitHub account, they have some cool stuff.

I use ACF primarily for the Flexible Content Field. ACF lets you export to PHP or json and load your fields via a plugin. Lately I’ve been plugin-ifying ACF functionality that I find myself recreating on more than one project, like Flexible Content Blocks and the extremely in-progress Cover Media, the former of which abstracts the ACF exported PHP so I can reuse fields between flexible content layouts.

Using ACF for these tools means my team is familiar with the way the fields look and operate, and I can count on ACF being around for a while since it’s so popular.

+1.

This has been a problem since I started in 2009. It sometimes feels particularly painful if you have experience with “real” frameworks.
I guess the issue is that most WP “developers” are not programmers, so the target audience for these kinds of things is much smaller.

I would add a couple of things, off the top of my head:

  • Users. WP has rather inconsistent function names and return values.
  • Admin interface. There are lots of common things you can do to make the admin UI super comfortable for your clients. For example, setting an archive page for a CPT the same way you set a page_for_posts.
  • There’s also lots of stuff I’ve had to repeat every time I build a WooCommerce site. Can’t remember details at the moment though…

I tried Timber a couple of years ago, but it felt too “raw” at that moment. Maybe it’s time to have a look again? It solves some of these problems, but I would definitely feel the need for another library to abstract and simply some common tasks.

So… let’s do something about this? :slight_smile:

1 Like

Awesome!

I know about these:

Thanks for the links, it seems that there are few options.

In my short experience with WP the forms and templates are two of the main pain points, so probably I’ll first check Timber and WP-Forms/CMB2 to see how they fit in my use cases. I’ll try to post here if there is something worth mentioning. Independently I might try to package Symfony Forms into a WP plugin and see how it works out. :slight_smile:

From the creator of Timber I’ve found two interesting plugins:

On to packaging everything into a framework, given my short experience with WP development, for now I’ll be more than happy if I find few good libraries to make development easier. I see it difficult (time is limited), but yes, eventually it would be cool to have something coherent and documented.

Any idea how to proceed? :innocent:

1 Like