Contents
When do you need a custom meta checkbox in WordPress?
There are times in WordPress when you need a custom field, but may not want to go through setting up a full custom meta box. Sometimes all you need is a simple checkbox that appears in the publish box. In this how-to, I’ll show you how to add a custom meta checkbox field to the existing post publish box.
How to add more fields to your meta box?
If you have to add more fields to your meta box, click the ‘+ Add Field’ button to add another field. Once you added fields, you can scroll down to the location section. This is where you can determine when and when you want to display your meta box. The Advanced Custom Fields always comes with some predefined rules for you to select from.
Is there a checkbox in the metadata schema editor?
After further investigation, I found that AEM list of OOTB form fields for metadata schemas includes a checkbox, but we cannot use the field as it is commented out. Here’s how you can add a checkbox in the metadata schema editor: When you refresh the schema editor you should now see the checkbox.
Are there checkboxes in AEM asset metadata schema?
Recently, a client requested I add a checkbox in AEM Asset’s image metadata schema. Surprisingly, checkboxes are not a field type in the OOTB metadata schema editor field options. After further investigation, I found that AEM list of OOTB form fields for metadata schemas includes a checkbox, but we cannot use the field as it is commented out.
How to add meta box to custom post type?
I have managed to add a meta box to my custom post type (see code below) Now I need to add another meta box. With this box I want to display / edit a value from another table called wp_project_bids_mitglied. This table contains a row with the post ids and a row with the values (0,1,2) that I would like to edit / display in my backend.
How to create a custom post submitbox in WordPress?
First we will need to hook into post_submitbox_misc_actions to add the custom field, and save_post to save the field. Then we need to create the functions being called within those, first we will create the custom field using the createCustomField function we specified above.