You know what, another interesting feature was released today. Since you update Meta Box to the latest version, you will see a new option in the field settings to enable the Add-new feature. Then, you will see a new thing below the field. It allows users add new posts, taxonomies, or users right in the custom fields without changing the screen.
Video
Before the Update
For instance, I have some custom fields for the event
post type like this.
One of them allows you to choose a post from the same post type to be related to the current post.
Previously, you can choose only the existing post in the field. If you want to create a new post and choose it in the field, you must go to the admin menu, create a post as usual.
Then go back to this post editor. Only then there is the post on the list to choose from. It seems like you had to change the screen a lot.
But from now on, it’s not like that anymore.
After the Update
Just stay on a post editor, you still can have another new one.
After updating to the latest version of Meta Box, you will see these 'Add new' button.
The name of the button will be auto-updated based on the post type you set for the field.
If you want a new post that does not exist on the list, just click on the Add-new button. A popup will display. It’s exactly the same with the post editor interface.
Add information for the new post. Close the popup, and you will see the post will be chosen in the field automatically.
Then, you also can see the new post on the list of the event
post type here.
Beside adding new posts, you also can add some new taxonomies in the same way.
It works even when the field is cloneable.
For users, you can add new ones as well.
How to Have This Feature
The latest version of Meta Box includes this feature and is now on wordpress.org. After updating to the latest version, there will be a new option in the field settings if you're using the UI provided by Meta Box Builder, just check this box to enable the Add-new button.
In the event that you create fields using code, you can add the add_new
attribute.
We believe that this feature will help you save a lot of time when setting some connections between posts, taxonomies, and users by diminishing moving to create a new one. Let’s update Meta Box and enjoy!