Custom Fields
Re-Envisioned
Support Meta Box Show Hide (Javascript) image_select value not working

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #9486
    Anh Tran
    Keymaster

    Hello,

    I’ve checked your code and it works for me. Here is the video:

    View post on imgur.com

    Please check the $prefix again. Probably you missed it.

    #9487
    webredox2
    Participant

    But it’s not working for ‘type’ => ‘image_select’,

    for select_advanced it’s working perfectly.

    I need a solution for image_select

    Thanks

    #9493
    Anh Tran
    Keymaster

    Sorry, I missed that. I thought the code is the code that you’re using.

    Yes, there’s a bug with the image_select field. It uses radio for inputs, so we can’t use #field_id in our rules. Please change it to [name=rnr_wr_pagetype] and update the plugin.

    #9494
    webredox2
    Participant

    Is there any way to use like below. I want to show a same metabox filed for two values. But it’s not working.

    'show'   => array(
        'input_value'   => array(
            'input[name=rnr_wr_pagetype]'  => 'st2',
            'input[name=rnr_wr_pagetype]'  => 'st3',
        ),
    ),
    #9496
    Anh Tran
    Keymaster

    Yes, you can do that. However, because PHP doesn’t allow to use same keys in an array, you need to change the selector to something else (while still make it work):

    'input_value' => array(
        'input[name=rnr_wr_pagetype]' => 'st2',
        'input[name*=rnr_wr_pagetype]' => 'st3',
    ),
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘image_select value not working’ is closed to new replies.

Newsletter

Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.


grid gear info copy caret-up caret-down trash