Custom Fields
Re-Envisioned
Support MB Admin Columns Field data (email) not showing on admin columns

This topic contains 2 replies, has 2 voices, and was last updated by  Anh Tran 2 weeks ago.

  • Creator
    Topic
  • #13534

    lighterdayz
    Participant

    On a custom post type, I need to show all custom fields in the admin columns. I can’t figure out how to get the data to show in the “email” column.

    Also, is there a way to prevent repeat submissions based on email address?

    Thanks in advance!
    Marge

    Screen grab

    add_filter( 'rwmb_meta_boxes', 'your_prefix_register_meta_boxes' );
    function your_prefix_register_meta_boxes( $meta_boxes ) {
        $meta_boxes[] = array (
            'title' => 'Turn Off Pledge',
            'id' => 'turn-off-pledge',
            'post_types' => array(
                0 => 'turn-off',
            ),
            'context' => 'normal',
            'priority' => 'high',
            'fields' => array(
                array (
                    'id' => 'Name',
                    'type' => 'text',
                    'name' => 'Name',
                    'admin_columns' => 'before title',
                ),
                array (
                    'id' => 'to-email',
                    'name' => 'Email',
                    'type' => 'email',
                    'required' => 1,
                    'admin_columns' => 'replace title',
                ),
                array (
                    'id' => 'your_profession',
                    'type' => 'taxonomy',
                    'name' => 'Profession',
                    'taxonomy' => 'profession',
                    'field_type' => 'checkbox_list',
                    'admin_columns' => 'before date',
                ),
            ),
        );
        return $meta_boxes;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • Author
    Replies
  • #13536

    lighterdayz
    Participant

    Well, the field started showing…not sure why, but the two first tests are still not showing. So, should be fine!

    But question #2 about repeat submissions would be great.

    Thanks!
    Marge

    #13610

    Anh Tran
    Keymaster

    Hi Marge,

    Also, is there a way to prevent repeat submissions based on email address?

    Do you mean if user submit a post that has an existing email in a custom field, then stop saving the post? As far as I know, there’s no way to stop WordPress from creating a post (unless you use die).

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.