image_select value not working

Support MB Show Hide image_select value not working

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #9484
    webredox2webredox2
    Participant

    Why meta box not showing for image select option?

    My code

    https://pastebin.com/Fjxw4yPP

    #9486
    Anh TranAnh Tran
    Keymaster

    Hello,

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

    https://imgur.com/a/J5HLUVi

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

    #9487
    webredox2webredox2
    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 TranAnh 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
    webredox2webredox2
    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 TranAnh 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 6 posts - 1 through 6 (of 6 total)
  • The topic ‘image_select value not working’ is closed to new replies.