Custom Fields
Re-Envisioned
Support MB Term Meta How to add a custom id to the "rwmb-meta-box" wrapper

This topic contains 3 replies, has 2 voices, and was last updated by  Anh Tran 1 year, 8 months ago.

  • Creator
    Topic
  • #8328
    Resolved
    uththamag
    Participant
    1. How to add a custom “id” to the
      <div class=”rwmb-meta-box” data-autosave=”false” data-object-type=”term”> wrapper.
    2. Also “rwmb-input” wrapper(<div>) should floated to the right side.The layout is not nice currently all items are floated to the left side.

    3. rwmb-meta-box wrapper is append after the <div class=”edit-tag-actions”>

    Are there any solutions?

    Thanx
    UG

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #8348

    Anh Tran
    Keymaster

    Hi UG,

    Thanks for your questions.

    1. Currently, the wrapper div is not extendable. Can you tell me why do you need an ID?

    2. Does the custom field have the name setting? Can you post a screenshot? It suppose to have the same table layout as other WordPress fields for terms.

    3. That’s right. It’s the only place that WordPress provides hook to show other custom fields. We can’t change it.

    #8353

    uththamag
    Participant

    Hi,

    1.I want to write some CSS to fix the layout issues. Is it possible to do that?

    2. Yes. Below is my code

        $meta_boxes[] = array(
            'id'         => 'service_tax',
            'title'      => null,
            'taxonomies' => 'categories', // List of taxonomies. Array or string
    
            'fields' => array(
                array(
                    'name'             => esc_html__( 'Featured Image', 'codice' ),
                    'id'               => "{$prefix}tax_thumb",
                    'type'             => 'image_advanced',
                    'max_file_uploads' => 1,
                    'max_status'       => false,
                ),
            ),
        ); 

    Post a screenshot to where?

    3. It should append before the <div class=”edit-tag-actions”>.

    #8383

    Anh Tran
    Keymaster

    Hi UG,

    1. If that’s the case, then you can use the id automatically created by WordPress. Each meta box will have a unique ID the same as the ID settings. See this screenshot:

    View post on imgur.com

    2. I’ve seen the issues with the code. No need screenshot anymore. I will check and fix it asap.

    3. I’ve checked and seen the fields appear before .edit-tag-actions. Here is how it appears on my side:

    View post on imgur.com

    PS: To upload the screenshot, you can use this app: https://getsharex.com/. It auto uploads images to imgur.com after taking screenshots. Then just paste the image URL here.

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

You must be logged in to reply to this topic.