Custom Fields
Re-Envisioned
Support General Metabox apply only to custom post

  • Creator
    Topic
  • #33237
    Hernan Orellana
    Participant

    I created a custom post type so that I could create a custom visual presentation for data entry. I tried using the Metabox online builder to create a backend GUI. How do I get the backend data entry GUI to appear ONLY on the custom Post type that I created? Right now it appears on all posts.

Viewing 1 replies (of 1 total)
  • Author
    Replies
  • #33244
    Long Nguyen
    Moderator

    Hi Hernan,

    You need to define the post_types setting when registering the meta box. For example:

    add_filter( 'rwmb_meta_boxes', 'prefix_register_meta_boxes' );
    function prefix_register_meta_boxes( $meta_boxes ) {
        $meta_boxes[] = [
            'title'      => 'Personal Information',
            'post_types' => 'post-type-slug', //here
            'id' => 'my-meta-box',
            'fields' => [
                ...
            ]
        ];
        return $meta_boxes;
    }

    Read more on the documentation https://docs.metabox.io/creating-meta-boxes/#field-group-settings

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.