Last active
December 13, 2015 21:08
-
-
Save Vheissu/4974811 to your computer and use it in GitHub Desktop.
Will allow you to display descriptions in the Wordpress Theme Customisation API settings sections.
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
add_action('customize_controls_print_footer_scripts', function() { | |
?> | |
<script type="text/javascript"> | |
(function($, window) { | |
$(document).ready(function() { | |
var $customisationOptions = $("#customize-theme-controls"); | |
if ($customisationOptions.length) { | |
$(".control-section", $customisationOptions).each(function() { | |
var $this = $(this); | |
var $heading = $(".customize-section-title", $this); | |
var $headingTitle = $heading.attr('title'); | |
var $sectionContent = $(".customize-section-content", $this); | |
if ($headingTitle) { | |
$heading.removeAttr('title'); | |
$sectionContent.append('<li class="customise-control"><p>'+$headingTitle+'</p></li>'); | |
} | |
}); | |
} | |
}); | |
})(jQuery, window); | |
</script> | |
<?php | |
}, 999); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment