iconicwp / WordPress-Settings-Framework

A settings framework for the WordPress settings API
MIT License
334 stars 66 forks source link

Added conditional description feature for <select> fields. #97

Closed davegreenwp closed 1 year ago

davegreenwp commented 1 year ago

Implements a Conditional Description feature that allows users to declare a conditional_desc field parameter containing an associative array, where the keys are the field values, and the values are the desired descriptions e.g.

    'choices' => array(
        'red'   => 'Red',
        'green' => 'Green',
        'blue'  => 'Blue',
    ),
    'conditional_desc' => array(
        'red'   => 'Description for value: red',
        'green' => 'Description for value: green',
        'blue'  => 'Description for value: blue',
    ),

The value will change dynamically using JS on field change.