From 8c23e502eaae8d31d982109aca0ecb59ebf0a7db Mon Sep 17 00:00:00 2001 From: Corey Collins Date: Mon, 9 Nov 2015 09:51:36 -0500 Subject: [PATCH] Update the footer copyright field to sanitize for HTML. Replaced the hardcoded footer text with the customizer footer copyright text. --- footer.php | 4 +--- inc/customizer.php | 4 ++-- inc/template-tags.php | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/footer.php b/footer.php index 01b9e9d65..f558b8ef6 100644 --- a/footer.php +++ b/footer.php @@ -21,9 +21,7 @@
- - | - Automattic' ); ?> +
diff --git a/inc/customizer.php b/inc/customizer.php index 3875aa64d..8bb13c3b7 100644 --- a/inc/customizer.php +++ b/inc/customizer.php @@ -61,8 +61,7 @@ function _s_customize_register( $wp_customize ) { $wp_customize->add_setting( '_s_copyright_text', array( - 'default' => '', - 'sanitize_callback' => '_s_sanitize_customizer_text' + 'default' => '' ) ); $wp_customize->add_control( @@ -72,6 +71,7 @@ function _s_customize_register( $wp_customize ) { 'description' => __( 'The copyright text will be displayed beneath the menu in the footer.', '_s' ), 'section' => '_s_footer_section', 'type' => 'text', + 'sanitize' => 'html' ) ); } diff --git a/inc/template-tags.php b/inc/template-tags.php index dd72efe57..9624d1456 100644 --- a/inc/template-tags.php +++ b/inc/template-tags.php @@ -253,3 +253,20 @@ function _s_get_attachment_id_from_url( $attachment_url = '' ) { return $attachment_id; } + +/** + * Echo the copyright text saved in the Customizer + */ +function _s_do_copyright_text() { + + // Grab our customizer settings + $copyright_text = get_theme_mod( '_s_copyright_text' ); + + // Stop if there's nothing to display + if ( ! $copyright_text ) { + return; + } + + // Echo the text + echo '' . wp_kses_post( $copyright_text ) . ''; +} \ No newline at end of file