Custom Fields
Re-Envisioned
Support General metabox removes multiple text field with html links inside

This topic contains 5 replies, has 2 voices, and was last updated by  Gunvor 8 months, 3 weeks ago.

  • Creator
    Topic
  • #12350
    Resolved
    Gunvor
    Participant

    I use code below for cloneable text field (and clone_as_multiple!). So when I put in a field html code like <a href=""> and the press Update post, the field just disappears.

    When I fill several fields with code like <a href=""> and press Update post several times then disappears only one by one field.

    function your_prefix_get_meta_box( $meta_boxes ) {
        $prefix = 'prefix-';
    
        $meta_boxes[] = array(
            'id' => 'untitled',
            'title' => esc_html__( 'Untitled Metabox', 'metabox-online-generator' ),
            'post_types' => array('d' ),
            'context' => 'advanced',
            'priority' => 'default',
            'autosave' => 'false',
            'fields' => array(
                array(
                    'id' => $prefix . 'text_1',
                    'type' => 'text',
                    'name' => esc_html__( 'Text', 'metabox-online-generator' ),
                    'clone' => 'true',
                    'clone_as_multiple' => true,
                ),
            ),
        );
    
        return $meta_boxes;
    }
    add_filter( 'rwmb_meta_boxes', 'your_prefix_get_meta_box' );
Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #12358

    Anh Tran
    Keymaster

    Hi Gunvor, I’ve just tried your code and seen the problem. I’ll fix it soon.

    #12386

    Anh Tran
    Keymaster

    Hi, I’ve just fixed this bug on Github. New version is coming soon.

    #12424

    Gunvor
    Participant

    There is another bug with this code. Put in #1 field “one”, then put in #2 field “two” and Save post. Now it’s ok, you see 2 fields https://i.ibb.co/Nj1MtZT/11.png. Then change “two” for “Two” (big letter https://i.ibb.co/gRgq4gq/22.png) and Save post – it’s gone

    #12450

    Anh Tran
    Keymaster

    Hi Gunvor, I’ve tested again and couldn’t see that bug. Here is my video: http://recordit.co/HdBt0F4baT

    Did you try the latest code on Github?

    #12490

    Gunvor
    Participant

    No I didn’t. But now I have tried, and it’s OK! Thanks!

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

You must be logged in to reply to this topic.