Freebie: create custom post meta with BB

Some time ago I made a feature request to allow BB to set custom post meta but didn’t get much attention, so we made a little script. This script can also set terms for the current post if you use a field like suggest. Be sure to check out the examples.php file and let me know if you have any suggestions.

ZestSMS Builder on Github

Hey Josh,

Very cool stuff! We’ll actually be discussing the roadmap soon, and my vote will be heavily towards theme templates and post meta, so you may see some traction on this soon. I think it’s going to revolutionize BB :slight_smile: I’ll take a deeper look at this once we get into that.

Justin

Could you elaborate? :wink:

Hey Josh,

We’d like to make it so you can build any page on your site with Beaver Builder. That means making templates for things like single.php, category.php, etc. and being able to pull in post meta as well. When we have the ability to pull in post meta, you could theoretically build AFC forms and have the data displayed in one of these new BB templates.

Justin

Just chiming in a +1 for this! I’ve got a rudimentary plugin to add template files for Genesis themes. Feel free to riff on it.

Thanks, Carrie! I’ll definitely check that out.

Could I request 2 filters? I’ve been thinking of making fall-back meta-boxes incase the user is unable to open BB (mobile). I would like to continue using $settings->$name to display the content in the frontend files since using anything else would remove the live preview.

  1. A filter on $value in render_settings_field()
  2. A filter on $settings in render_module_html()

With these two filters in place, I believe I can display the meta value in both the settings form and frontend files if it does not match what’s saved in _fl_builder_data.

Hey Josh,

Would you mind posting that in our User Voice forum by chance? We track all feature requests there and will definitely take a look asap!

Best,
Billy

Not sure if anyone uses this or not but I’ve just updated the github. Now all you need to do is add a ‘meta’ attribute (bool or array) to the field settings array.

Essentially the script works by storing the field value (or custom value) in the post_meta table with the supplied key, unsets the field in _fl_builder_data and _fl_builder_draft, and sets the default of the field to what is set in the post_meta table.

Hey Josh,

Thanks for the update! We just started diving into creating templates for posts/archives/404 pages and will be looking into post meta as well. I’ll definitely check this out!

Justin

Great!

Not sure if you’ve considered it or not but single-use modules would be useful for this sort of thing so users can’t overwrite (think a Featured Image module on the page multiple times).

"Hey Josh,

Thanks for the update! We just started diving into creating templates for posts/archives/404 pages and will be looking into post meta as well. I’ll definitely check this out!

Justin"

This sounds great, I was just looking at a way to edit the 404 template to add the menu.
Looks like this might be something that will also make it easy to create a template for post and possibly the posts page.