Skip to content

Instantly share code, notes, and snippets.

@westonruter
Last active October 10, 2017 04:18
Show Gist options
  • Select an option

  • Save westonruter/9defddf56888db0fbb8c4c05f3a3bd6f to your computer and use it in GitHub Desktop.

Select an option

Save westonruter/9defddf56888db0fbb8c4c05f3a3bd6f to your computer and use it in GitHub Desktop.
Add help text to the end of the Custom CSS section in the Customizer.
<?php
add_action( 'customize_register', function( $wp_customize ) {
$custom_css_section = $wp_customize->get_section( 'custom_css' );
if ( $custom_css_section ) {
// @todo The section-description-buttons should really not be part of the description help text.
$custom_css_section->description = preg_replace(
'/(?=<p class="section-description-buttons)|$/',
'<p>' . __( 'Here are some additional instructions for the theme, for example certain class names or IDs to target.' ) . '</p>',
$custom_css_section->description,
1
);
}
}, 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment