reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!
http://redux.io
Other
1.73k stars 583 forks source link

Using required argument in the checkbox field with typography as parent #3291

Closed bilal-pp closed 7 years ago

bilal-pp commented 7 years ago

Hi, I want to display some checkbox fields only if the parent typography filed's font-family equals to any of the google fonts. Below is the sample code:

                           array(
                'id' => 'heading_font',
                'type' => 'typography',
                'title' => 'Headings',
                'output' => array('h1','h2','h3','h4','h5','h6'),
                'font-weight' => false,
                'font-style' => false,
                'text-align' => false,
                'line-height' => false,
                'color' => false,
                'font-size' => false,
                'google' => true,
                'subsets' => true,
                'preview' => array(
                    'text' => 'Heading Preview',
                    'font-size' => '30px',
                    'always_display' => true
                ),
                'default' => array(
                    'font-family' => 'Open Sans',
                    'color' => '#000000',
                    'font-size' => '30px',
                    'google' => true,
                )
            ),
            array(
                'id' => 'checkbox_1',
                'desc' => 'checkbox_1',
                'type' => 'checkbox',
                'required' => array('paperplane_heading_font_options', 'equals', 'Overlock')
            ),
            array(
                'desc' => 'checkbox 2',
                'id' => 'checkbox_2',
                'type' => 'checkbox',
                                    'required' => array('heading_font', 'equals', 'Overlock')
            ), 

But the above code does not work, the checkbox fields are hidden but even after changing the font-family to Overlock, checkbox fields won't appear. Could you guys please provide me the solution.

kprovance commented 7 years ago

Trying pulling v.3.6.4.2 from this repo. The issue should now be solved.