0

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?

1

I 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);
}
  • But don't you need to save them before you call get_post_meta? – A.Ahmad Aug 10 '17 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.