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

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

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.