浏览代码

Varia: Add learn more link to color contrast message.

Allan Cole 5 年之前
父节点
当前提交
9c90ec9981
共有 1 个文件被更改,包括 4 次插入13 次删除
  1. 4 13
      varia/inc/wpcom.php

+ 4 - 13
varia/inc/wpcom.php

@@ -52,7 +52,10 @@ function varia_wpcom_customize_update( $wp_customize ) {
     $wp_customize->add_control( 'color_a11y_warning', array(
         'id'          => 'id',
         'label'       => esc_html__( 'Color Accessibility Warning', 'varia' ),
-		'description' => esc_html__( 'In order to ensure people can read your site, try to maintain a strong contrast ratio between the colors you choose here. Learn more.', 'varia' ),
+		'description' => sprintf(
+							__( 'In order to ensure people can read your site, try to maintain a strong contrast ratio between the colors you choose here. <a href="%s" target="_blank">Learn more about color contrast</a>.', 'varia' ),
+							esc_url( 'https://a11yproject.com/posts/what-is-color-contrast/' )
+						 ),
         'section'     => 'colors_manager_tool',
 		'priority'	  => 10,
 		'type'		  => 'hidden',
@@ -153,15 +156,3 @@ function varia_enqueue_message_scripts() {
 	wp_enqueue_style( 'varia-customize-message-wpcom-style', get_template_directory_uri() . '/inc/customize-message-wpcom.css', array(), wp_get_theme()->get( 'Version' ) );
 }
 add_action( 'customize_controls_enqueue_scripts', 'varia_enqueue_message_scripts' );
-
-/**
- * Add message about a11y
- */
-function varia_print_customizer_message() {
-	?>
-	<script type="text/html" id="tmpl-varia-custom-message">
-		<p class="varia-custom-message"><?php esc_html_e( 'This is a custom message being added to the WordPress Customizer.', 'varia' ) ?></p>
-	</script>
-	<?php
-}
-add_action( 'customize_controls_print_footer_scripts', 'varia_print_customizer_message' );