Make WordPress Core


Ignore:
Timestamp:
11/19/2018 09:26:02 PM (6 years ago)
Author:
allancole
Message:

Updating Twenty Nineteen, our new default theme for 2019, set for 5.0.

This update changes the following:

  • Fix JS errors in customizer caused by menu scripts
  • Fix footer menu spacing
  • Fix pullquote block borders to follow Gutenberg’s described style
  • Fix editor-only styles so they don't appear on the frontend when not needed
  • Fix search field widget width on mobile
  • Fix :visited .button link colors
  • Fix Block toolbar position in the editor
  • Fix off-canvas mobile menu to prevent text from overflowing
  • Improve column block formatting for the editor and frontend
  • Improve CSS optimization for selectors that add dashes to multi-level lists
  • Improve editor font sizes to use pixels over ems
  • Improve styles for galleries in the Classic Editor block
  • Improve priority+ more-menu threshold to allow more space for menu-items
  • Improve logo size on mobile devices
  • Improve customizer color options to present a single, unified color option
  • Improve print stylesheet for better spacing and colors
  • Add more color options to Gutenberg editor

Initial development occurred on GitHub. See: https://github.com/WordPress/twentynineteen

Props allancole, karmatosed, kjellr, yingling017, mrasharirfan, milana_cap, fabiankaegy, westonruter, jorbin, netweb, b-07, khleomix, audrasjb, nielslange, mmaumio, richsalvucci, littlebigthing, dimadin, joyously, anevins, peterwilsoncc, dannycooper, iCaleb, siriokun, technosiren, travel_girl, azchughtai, ianbelanger, nadim1992, ismailelkorchi, nativeinside, chetan200891, grapplerulrich, ocean90, joshfeck, frankew, AbdulWahab610, mendezcode, eliorivero, melchoyce, joen, laurelfulford, mdawaffe, kraftbj, dsmart, nao, mayukojpn, enodekciw, ketuchetan, atanasangelovdev, poena, sharaz, artisticasad, mukesh27, burhandodhy, crunnells, aprakasa, themeroots, imonly_ik, tlxo, youthkee, brentswisher, smyoon315, mrahmadawais, desideveloper, Kau-Boy, mor10, mikeyarce, dingo_bastard

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-content/themes/twentynineteen/inc/customizer.php

    r43860 r43909  
    11<?php
    22/**
    3  * Twenty Nineteen Theme Customizer
     3 * Twenty Nineteen: Customizer
    44 *
    55 * @package WordPress
     
    3636
    3737    /**
    38      * Custom colors.
     38     * Primary color.
    3939     */
    4040    $wp_customize->add_setting(
    41         'colorscheme',
     41        'primary_color',
    4242        array(
    4343            'default'           => 'default',
     
    4848
    4949    $wp_customize->add_control(
    50         'colorscheme',
     50        'primary_color',
    5151        array(
    5252            'type'     => 'radio',
    53             'label'    => __( 'Color Scheme', 'twentynineteen' ),
     53            'label'    => __( 'Primary Color', 'twentynineteen' ),
    5454            'choices'  => array(
    55                 'default'  => _x( 'Default', 'color scheme', 'twentynineteen' ),
    56                 'custom' => _x( 'Custom', 'color scheme', 'twentynineteen' ),
     55                'default'  => _x( 'Default', 'primary color', 'twentynineteen' ),
     56                'custom' => _x( 'Custom', 'primary color', 'twentynineteen' ),
    5757            ),
    5858            'section'  => 'colors',
     
    6161    );
    6262
    63     // Add primary color setting and control.
     63    // Add primary color hue setting and control.
    6464    $wp_customize->add_setting(
    65         'colorscheme_primary_hue',
     65        'primary_color_hue',
    6666        array(
    6767            'default'           => 199,
     
    7474        new WP_Customize_Color_Control(
    7575            $wp_customize,
    76             'colorscheme_primary_hue',
     76            'primary_color_hue',
    7777            array(
    78                 'label'       => __( 'Primary Color', 'twentynineteen' ),
    79                 'description' => __( 'Changes the Color of the Featured Image overlay, Buttons, Links etc.', 'twentynineteen' ),
     78                'description' => __( 'Apply a custom color for buttons, links, featured images, etc.', 'twentynineteen' ),
    8079                'section'     => 'colors',
    8180                'mode'        => 'hue',
     
    8483    );
    8584
     85    // Add image filter setting and control.
    8686    $wp_customize->add_setting(
    8787        'image_filter',
    8888        array(
    89             'default'           => 'active',
    90             'sanitize_callback' => 'twentynineteen_sanitize_image_filter',
     89            'default'           => 1,
     90            'sanitize_callback' => 'absint',
    9191            'transport'         => 'postMessage',
    9292        )
     
    9696        'image_filter',
    9797        array(
    98             'label'       => __( 'Featured Image Color Filter', 'twentynineteen' ),
    99             'section'     => 'colors',
    100             'type'        => 'radio',
    101             'description' => __( "Twenty Nineteen adds a color filter to featured images using your site's primary color. If you disable this effect, the theme will use a black filter in individual posts to keep text readable when it appears on top of the featured image.", 'twentynineteen' ) . '<br/><span style="font-style: normal; display: block; margin-top: 16px;">' . __( 'On Featured Images, apply', 'twentynineteen' ) . '</span>',
    102             'choices'     => array(
    103                 'active'   => __( 'A color filter', 'twentynineteen' ),
    104                 'inactive' => __( 'A black filter', 'twentynineteen' ),
    105             ),
     98            'label'   => __( 'Apply a filter to featured images using the primary color', 'twentynineteen' ),
     99            'section' => 'colors',
     100            'type'    => 'checkbox',
    106101        )
    107102    );
     
    144139
    145140/**
    146  * Sanitize image filter choice.
     141 * Sanitize custom color choice.
    147142 *
    148143 * @param string $choice Whether image filter is active.
     
    162157    return 'default';
    163158}
    164 /**
    165  * Sanitize image filter choice.
    166  *
    167  * @param string $choice Whether image filter is active.
    168  *
    169  * @return string
    170  */
    171 function twentynineteen_sanitize_image_filter( $choice ) {
    172     $valid = array(
    173         'active',
    174         'inactive',
    175     );
    176 
    177     if ( in_array( $choice, $valid, true ) ) {
    178         return $choice;
    179     }
    180 
    181     return 'active';
    182 }
Note: See TracChangeset for help on using the changeset viewer.