Support Forum
Support › MB Custom Table › Custom Model
Hi,
Apologies if there are a few of these tickets. Just starting to use the new (and wonderful) Custom Model capability for real...
Is there any way to add to or edit the 'mbct-submit' postbox on an add/edit screen? I'd like to display the 'created_at' and other meta data in there as per WP standard post types. Additionally I'd like to add our custom 'Save and Close' button.
Finally how would one configure user role 'capabilities' for a Custom Model?
Thanks in advance,
Will
Sorry one more thing...
Is there any way to control the h1 heading when editing an existing record? Currently it is 'Edit Item #<ID>. I'd like to be able to use one of my custom fields to insert the record name eg. "Edit Item: John Smith"
All the best,
Will
Hi Will,
Let me answer your questions.
You can use the Meta Box action hooks rwmb_{$meta_box_id}_after_save_post
or rwmb_{$field_id}_after_save_field
to run a public API add
function to add value for an object. Please read more on the documentation
https://docs.metabox.io/actions/
https://docs.metabox.io/extensions/mb-custom-table/#add
Currently, the plugin does not support modifying the Submit button. You can try to use a translation plugin to translate the button text.
Please use the setting capability
to control access to the model based on capability. Please read more here https://docs.metabox.io/extensions/mb-custom-table/#step-1-register-a-model
It is not supported. I will inform the development team to support changing the item ID by a field value in the heading.
Thanks Long, very helpful!
Just to clarify - on #2 I am not trying to change the actual Submit button but instead add content to the same postbox above the button iteself, eg.
Created: 01/09/2021
Modified: 23/09/2022
Hi,
It is not possible for now. I will inform the development team to create an action hook to show something in that box.