Changeset 46445 for trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php
- Timestamp:
- 10/08/2019 07:05:53 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php
r46357 r46445 91 91 'header_footer_background_color', 92 92 array( 93 'label' => esc_html__( 'Header &Footer Background Color', 'twentytwenty' ),93 'label' => __( 'Header & Footer Background Color', 'twentytwenty' ), 94 94 'section' => 'colors', 95 95 ) 96 ) 97 ); 98 99 // Enable picking an accent color. 100 $wp_customize->add_setting( 101 'accent_hue_active', 102 array( 103 'capability' => 'edit_theme_options', 104 'sanitize_callback' => array( __CLASS__, 'sanitize_select' ), 105 'transport' => 'postMessage', 106 'default' => 'default', 107 ) 108 ); 109 110 $wp_customize->add_control( 111 'accent_hue_active', 112 array( 113 'type' => 'radio', 114 'section' => 'colors', 115 'label' => __( 'Primary Color', 'twentytwenty' ), 116 'choices' => array( 117 'default' => __( 'Default', 'twentytwenty' ), 118 'custom' => __( 'Custom', 'twentytwenty' ), 119 ), 96 120 ) 97 121 ); … … 137 161 'type' => 'theme_mod', 138 162 'transport' => 'postMessage', 139 'sanitize_callback' => array( 'TwentyTwenty_Customize', 'sanitize_accent_accessible_colors' ),163 'sanitize_callback' => array( __CLASS__, 'sanitize_accent_accessible_colors' ), 140 164 ) 141 165 ); … … 147 171 'accent_hue', 148 172 array( 149 'label' => esc_html__( 'Accent Color Hue', 'twentytwenty' ), 150 'section' => 'colors', 151 'settings' => 'accent_hue', 152 'mode' => 'hue', 173 'section' => 'colors', 174 'settings' => 'accent_hue', 175 'description' => __( 'Apply a custom color for links, buttons, featured images.', 'twentytwenty' ), 176 'mode' => 'hue', 177 'active_callback' => function() use ( $wp_customize ) { 178 return ( 'custom' === $wp_customize->get_setting( 'accent_hue_active' )->value() ); 179 }, 153 180 ) 154 181 ) … … 165 192 'options', 166 193 array( 167 'title' => __( 'Theme Options', 'twentytwenty' ), 168 'priority' => 40, 169 'capability' => 'edit_theme_options', 170 'description' => __( 'Specific settings for the Twenty Twenty theme.', 'twentytwenty' ), 194 'title' => __( 'Theme Options', 'twentytwenty' ), 195 'priority' => 40, 196 'capability' => 'edit_theme_options', 171 197 ) 172 198 ); … … 226 252 'title' => __( 'Cover Template', 'twentytwenty' ), 227 253 'capability' => 'edit_theme_options', 228 'description' => __( 'Settings for the "Cover Template" page template. ', 'twentytwenty' ),254 'description' => __( 'Settings for the "Cover Template" page template. Add a featured image to use as background.', 'twentytwenty' ), 229 255 'priority' => 42, 230 256 ) … … 295 321 'cover_template_overlay_background_color', 296 322 array( 297 'label' => __( ' ImageOverlay Background Color', 'twentytwenty' ),298 'description' => __( 'The color used for the featured imageoverlay. Defaults to the accent color.', 'twentytwenty' ),323 'label' => __( 'Overlay Background Color', 'twentytwenty' ), 324 'description' => __( 'The color used for the overlay. Defaults to the accent color.', 'twentytwenty' ), 299 325 'section' => 'cover_template_options', 300 326 ) … … 317 343 'cover_template_overlay_text_color', 318 344 array( 319 'label' => __( ' ImageOverlay Text Color', 'twentytwenty' ),320 'description' => __( 'The color used for the text in the featured imageoverlay.', 'twentytwenty' ),345 'label' => __( 'Overlay Text Color', 'twentytwenty' ), 346 'description' => __( 'The color used for the text in the overlay.', 'twentytwenty' ), 321 347 'section' => 'cover_template_options', 322 348 ) … … 338 364 'cover_template_overlay_opacity', 339 365 array( 340 'label' => __( ' ImageOverlay Opacity', 'twentytwenty' ),366 'label' => __( 'Overlay Opacity', 'twentytwenty' ), 341 367 'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'twentytwenty' ), 342 368 'section' => 'cover_template_options', … … 384 410 * @param string $input The input from the setting. 385 411 * @param object $setting The selected setting. 412 * 413 * @return string $input|$setting->default The input from the setting or the default setting. 386 414 */ 387 415 public static function sanitize_select( $input, $setting ) { … … 394 422 * Sanitize boolean for checkbox. 395 423 * 396 * @param bool $checked Wethere or not a blox is checked. 424 * @param bool $checked Whether or not a box is checked. 425 * 426 * @return bool 397 427 */ 398 428 public static function sanitize_checkbox( $checked ) {
Note: See TracChangeset
for help on using the changeset viewer.