Skip to content

Instantly share code, notes, and snippets.

@Vheissu
Last active December 13, 2015 21:08
Show Gist options
  • Save Vheissu/4974811 to your computer and use it in GitHub Desktop.
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.
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