I've got a custom post type for contact form submissions. I'm using the JSON API, so these form submissions get posted directly to WordPress.
I've got it to display custom meta columns (e.g. first name, last name, email address) in the admin, however I now need it to show these columns in the edit page.
Note, I only need to output these columns, not have them displayed in form fields.
How do I do this?
I've got a custom post type for contact form submissions. I'm using the JSON API, so these form submissions get posted directly to WordPress.
I've got it to display custom meta columns (e.g. first name, last name, email address) in the admin, however I now need it to show these columns in the edit page.
Note, I only need to output these columns, not have them displayed in form fields.
How do I do this?
Share Improve this question asked Aug 10, 2017 at 17:32 MAX POWERMAX POWER 2254 silver badges9 bronze badges1 Answer
Reset to default 3I found the answer:
add_action('add_meta_boxes', 'add_contact_form_meta_box');
function add_contact_form_meta_box() {
add_meta_box('contact-form-meta-box-id', 'Submission Data', 'contact_form_meta_box', 'contact_form', 'normal', 'high');
}
function contact_form_meta_box($post) {
echo get_post_meta($post->ID, 'first_name', true);
}