Make WordPress Core


Ignore:
Timestamp:
10/08/2019 07:05:53 PM (5 years ago)
Author:
desrosj
Message:

Bundled Themes: Update Twenty Twenty.

This brings trunk's version of Twenty Twenty in-sync with GitHub.

For a complete list of changes since [46357], see https://github.com/WordPress/twentytwenty/compare/7157870...7246fd6.

Props anlino, ianbelanger, poena, williampatton, nielslange, acosmin, netweb, joyusly, luminuu, itowhid06, cbravobernal, intimez, glauberglauber, ocean90, amolv, briceduclos, aristath, mukesh27, garrett-eclipse, audrasjb, afercia, dianeco, utsav72640, mahesh901122, tobifjellner.
See #48110.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentytwenty/classes/class-twentytwenty-customize.php

    r46357 r46445  
    9191                    'header_footer_background_color',
    9292                    array(
    93                         'label'   => esc_html__( 'Header & Footer Background Color', 'twentytwenty' ),
     93                        'label'   => __( 'Header & Footer Background Color', 'twentytwenty' ),
    9494                        'section' => 'colors',
    9595                    )
     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                    ),
    96120                )
    97121            );
     
    137161                    'type'              => 'theme_mod',
    138162                    'transport'         => 'postMessage',
    139                     'sanitize_callback' => array( 'TwentyTwenty_Customize', 'sanitize_accent_accessible_colors' ),
     163                    'sanitize_callback' => array( __CLASS__, 'sanitize_accent_accessible_colors' ),
    140164                )
    141165            );
     
    147171                    'accent_hue',
    148172                    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                        },
    153180                    )
    154181                )
     
    165192                'options',
    166193                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',
    171197                )
    172198            );
     
    226252                    'title'       => __( 'Cover Template', 'twentytwenty' ),
    227253                    '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' ),
    229255                    'priority'    => 42,
    230256                )
     
    295321                    'cover_template_overlay_background_color',
    296322                    array(
    297                         'label'       => __( 'Image Overlay Background Color', 'twentytwenty' ),
    298                         'description' => __( 'The color used for the featured image overlay. 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' ),
    299325                        'section'     => 'cover_template_options',
    300326                    )
     
    317343                    'cover_template_overlay_text_color',
    318344                    array(
    319                         'label'       => __( 'Image Overlay Text Color', 'twentytwenty' ),
    320                         'description' => __( 'The color used for the text in the featured image overlay.', 'twentytwenty' ),
     345                        'label'       => __( 'Overlay Text Color', 'twentytwenty' ),
     346                        'description' => __( 'The color used for the text in the overlay.', 'twentytwenty' ),
    321347                        'section'     => 'cover_template_options',
    322348                    )
     
    338364                'cover_template_overlay_opacity',
    339365                array(
    340                     'label'       => __( 'Image Overlay Opacity', 'twentytwenty' ),
     366                    'label'       => __( 'Overlay Opacity', 'twentytwenty' ),
    341367                    'description' => __( 'Make sure that the contrast is high enough so that the text is readable.', 'twentytwenty' ),
    342368                    'section'     => 'cover_template_options',
     
    384410         * @param string $input The input from the setting.
    385411         * @param object $setting The selected setting.
     412         *
     413         * @return string $input|$setting->default The input from the setting or the default setting.
    386414         */
    387415        public static function sanitize_select( $input, $setting ) {
     
    394422         * Sanitize boolean for checkbox.
    395423         *
    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
    397427         */
    398428        public static function sanitize_checkbox( $checked ) {
Note: See TracChangeset for help on using the changeset viewer.