Created
May 11, 2018 18:52
-
-
Save DannyCooper/22068201b5612723a3750853984b4113 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Scripts to alter the behavior of Customizer controls. | |
*/ | |
( function( $ ) { | |
'use strict'; | |
wp.customize.bind( 'ready', function() { | |
hideFooterSettings(); | |
wp.customize( 'sub-footer-layout', function( value ) { | |
value.bind( function( newval ) { | |
hideFooterSettings(); | |
} ); | |
} ); | |
function hideFooterSettings() { | |
var settingValue = wp.customize.control('sub-footer-layout').setting.get(); | |
if ( settingValue === 'centered' ) { | |
wp.customize.control('sub-footer-content').container.show(); | |
wp.customize.control('sub-footer-content-left').container.hide(); | |
wp.customize.control('sub-footer-content-right').container.hide(); | |
} else { | |
wp.customize.control('sub-footer-content').container.hide(); | |
wp.customize.control('sub-footer-content-left').container.show(); | |
wp.customize.control('sub-footer-content-right').container.show(); | |
} | |
} | |
} ); | |
}( jQuery ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment