- Timestamp:
- 11/19/2018 09:26:02 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-content/themes/twentynineteen/functions.php
r43892 r43909 108 108 add_editor_style( 'style-editor.css' ); 109 109 110 // Add custom editor font sizes 111 add_theme_support( 112 'editor-font-sizes', 113 array( 114 array( 115 'name' => __( 'Small', 'twentynineteen' ), 116 'shortName' => __( 'S', 'twentynineteen' ), 117 'size' => 19.5, 118 'slug' => 'small', 119 ), 120 array( 121 'name' => __( 'Normal', 'twentynineteen' ), 122 'shortName' => __( 'M', 'twentynineteen' ), 123 'size' => 22, 124 'slug' => 'normal', 125 ), 126 array( 127 'name' => __( 'Large', 'twentynineteen' ), 128 'shortName' => __( 'L', 'twentynineteen' ), 129 'size' => 36.5, 130 'slug' => 'large', 131 ), 132 array( 133 'name' => __( 'Huge', 'twentynineteen' ), 134 'shortName' => __( 'XL', 'twentynineteen' ), 135 'size' => 49.5, 136 'slug' => 'huge', 137 ), 138 ) 139 ); 140 110 141 // Editor color palette. 111 142 add_theme_support( … … 113 144 array( 114 145 array( 115 'name' => __( 'Primary Color', 'twentynineteen' ),146 'name' => __( 'Primary', 'twentynineteen' ), 116 147 'slug' => 'primary', 117 'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'colorscheme' ) ? 199 : get_theme_mod( 'colorscheme_primary_hue', 199 ), 100, 33 ), 148 'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 33 ), 149 ), 150 array( 151 'name' => __( 'Secondary', 'twentynineteen' ), 152 'slug' => 'secondary', 153 'color' => twentynineteen_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 23 ), 154 ), 155 array( 156 'name' => __( 'Dark Gray', 'twentynineteen' ), 157 'slug' => 'dark-gray', 158 'color' => '#111', 159 ), 160 array( 161 'name' => __( 'Light Gray', 'twentynineteen' ), 162 'slug' => 'light-gray', 163 'color' => '#767676', 164 ), 165 array( 166 'name' => __( 'White', 'twentynineteen' ), 167 'slug' => 'white', 168 'color' => '#FFF', 118 169 ), 119 170 ) … … 122 173 // Add support for responsive embedded content. 123 174 add_theme_support( 'responsive-embeds' ); 124 125 175 } 126 176 endif; … … 194 244 wp_enqueue_style( 'twentynineteen-editor-customizer-styles', get_theme_file_uri( '/style-editor-customizer.css' ), false, '1.0', 'all' ); 195 245 196 if ( 'custom' === get_theme_mod( ' colorscheme' ) ) {246 if ( 'custom' === get_theme_mod( 'primary_color' ) ) { 197 247 // Include color patterns 198 248 require_once get_parent_theme_file_path( '/inc/color-patterns.php' ); … … 208 258 209 259 // Only include custom colors in customizer or frontend. 210 if ( ( ! is_customize_preview() && 'default' === get_theme_mod( ' colorscheme', 'default' ) ) || is_admin() ) {260 if ( ( ! is_customize_preview() && 'default' === get_theme_mod( 'primary_color', 'default' ) ) || is_admin() ) { 211 261 return; 212 262 } … … 214 264 require_once get_parent_theme_file_path( '/inc/color-patterns.php' ); 215 265 216 if ( 'default' === get_theme_mod( ' colorscheme', 'default' ) ) {266 if ( 'default' === get_theme_mod( 'primary_color', 'default' ) ) { 217 267 $primary_color = 199; 218 268 } else { 219 $primary_color = absint( get_theme_mod( ' colorscheme_primary_hue', 199 ) );269 $primary_color = absint( get_theme_mod( 'primary_color_hue', 199 ) ); 220 270 } 221 271 ?>
Note: See TracChangeset
for help on using the changeset viewer.