Skip to content

From "Aquapussy" #20

@kprovance

Description

@kprovance

Support Hash

http://support.redux.io/?id=9FJlT07Mel91jIwDEbPAQQrAo%2BcCfNkbnkoBZ8rzPrsc9yKMX%2BwN%2BIs6%2FBoLfc4naOawDfXzgj%2B%2Fzu8FYyFLwQ%3D%3D

Steps to reproduce

Text field options are showing up in customizer when they should be hidden. I notice it is happening in the demo as well:

Demo link (works fine here in admin panel - nested required field not showing until toggle is switched)

http://i.imgur.com/UWU3fJA.png

Customizer toggle you can see the field showing though it's "off".

On my site, all other fields should be hidden but for the one in the select box. However, the "Logo Image" and "Custom Text" fields show no matter what is selected. Also, some of the fields don't show such as dimensions.

http://i.imgur.com/rlEIIhk.png

Expected Behavior

It works perfectly fine in admin panel.

http://imgur.com/8GOVyvJ

Any Error Details (PHP/JavaScript)

No errors

My options code:

 Redux::setSection( $opt_name, array(
	'title'      => __( 'Logo Options', 'gomaxchild' ),
	'id'         => 'gm-logo-section',
	'desc'       => __( 'Choose from an image logo or optionally you may add a text logo, or just use the title of your website', 'gomaxchild' ),
	//'subsection' => true,
	'fields'     => array(
		array(
			'id'       => 'gm-logo-select',
			'type'     => 'select',
			'title'    => 'Select Option',
			'subtitle' => 'Choose how you would like your logo displayed',
			//'desc'     => __( 'This is the description field, again good for additional info.', 'gomaxchild' ),
			// Must provide key => value pairs for select options
			'options'  => array(
				'logo-image'  => 'Logo Image',
				'site-title'  => 'Site Title',
				'site-title-tag'   => 'Site Title + Tagline',
				'custom-text' => 'Custom Text'
			),
			'default'  => 'logo-image'
		//	'select2'  => array( 'allowClear' => false )
		),
		array(
			'id'       => 'gm-logo-image-opt',
			'type'     => 'media',
			'title'    => 'Image Logo',
			'url'      => 'true',
			'preview'  => 'true',
			'compiler' => 'true',
			'class'    => '',
			'required' => array( 'gm-logo-select', '=', 'logo-image' ),
			'default'  => array( 'url' => 'http://via.placeholder.com/250x75' )

		),
		array(
			'id'             => 'gm-logo-dimensions',
			'type'           => 'dimensions',
			'units'          => array( 'px' ),    // You can specify a unit value. Possible: px, em, %
			'units_extended' => 'false',  // Allow users to select any type of unit
			'title'          => __( 'Dimensions (Width/Height) Option', 'gomaxchild' ),
			'subtitle'       => __( 'Choose dimensions of your logo.', 'gomaxchild' ),
			'desc'           => __( 'You can enable or disable any piece of this field. Width, Height, or Units.', 'gomaxchild' ),
			'default'        => array(
				'width'  => 250,
				'height' => 75,
			),
			'required'       => array( 'gm-logo-select', '=', 'logo-image' )
		),

		array (
			'id' => 'gm-site-title-opt',
			'type' => 'info',
			'style' => 'success',
			'title' => __('Use the current page title as your logo', 'gomaxchild'),
			'subtitle' => sprintf( '<div class="logo-item title">%s</div>', $site_title ),
			'required' => array( 'gm-logo-select', '=', 'site-title' )

		),
		array (
			'id' => 'gm-title-tag-opt',
			'type' => 'info',
			'style' => 'success',
			'title' => __('Use the current page title AND tagline as your logo', 'gomaxchild'),
			'subtitle' => sprintf( '<div class="logo-item title_tagline">%s</div>', $site_title_tagline ),
			'required' => array( 'gm-logo-select', '=', 'site-title-tag' )

		),
		array(
			'id'       => 'gm-custom-text-opt',
			'type'     => 'text',
			'title'    => 'Custom Title',
			'required' => array( 'gm-logo-select', '!=', 'logo-image' ), //tried this just to see if it would help
			array( 'gm-logo-select', '=', 'custom-text' )

		),
		array(
			'id'       => 'gm-custom-tag-opt',
			'type'     => 'text',
			'title'    => 'Custom Tagline (optional)',
			'required' => array( 'gm-logo-select', '=', 'custom-text' )

		)
	)
) ); 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions