diff --git a/docs/designers-developers/developers/themes/theme-json.md b/docs/designers-developers/developers/themes/theme-json.md index e1a50ce95a428f..29d31d5ec3b3e9 100644 --- a/docs/designers-developers/developers/themes/theme-json.md +++ b/docs/designers-developers/developers/themes/theme-json.md @@ -163,6 +163,7 @@ The settings section has the following structure and default values: "color": { "custom": true, /* false to opt-out, as in add_theme_support('disable-custom-colors') */ "customGradient": true, /* false to opt-out, as in add_theme_support('disable-custom-gradients') */ + "duotone": [ ... ], /* duotone presets, a list of { "colors": [ "#000", "#FFF" ] } */ "gradients": [ ... ], /* gradient presets, as in add_theme_support('editor-gradient-presets', ... ) */ "link": false, /* true to opt-in, as in add_theme_support('experimental-link-color') */ "palette": [ ... ], /* color presets, as in add_theme_support('editor-color-palette', ... ) */ diff --git a/lib/blocks.php b/lib/blocks.php index 8fbc900d7ecb19..c7ec3e3c04d52b 100644 --- a/lib/blocks.php +++ b/lib/blocks.php @@ -26,7 +26,6 @@ function gutenberg_reregister_core_block_types() { 'group', 'heading', 'html', - 'image', 'list', 'media-text', 'missing', @@ -55,6 +54,7 @@ function gutenberg_reregister_core_block_types() { 'calendar.php' => 'core/calendar', 'categories.php' => 'core/categories', 'cover.php' => 'core/cover', + 'image.php' => 'core/image', 'latest-comments.php' => 'core/latest-comments', 'latest-posts.php' => 'core/latest-posts', 'navigation.php' => 'core/navigation', diff --git a/lib/class-wp-theme-json-resolver.php b/lib/class-wp-theme-json-resolver.php index 0352e9e9a44798..263a2f3847de59 100644 --- a/lib/class-wp-theme-json-resolver.php +++ b/lib/class-wp-theme-json-resolver.php @@ -255,6 +255,22 @@ public static function get_core_data() { } } + $default_duotone_i18n = array( + 'dark-grayscale' => __( 'Dark grayscale', 'gutenberg' ), + 'grayscale' => __( 'Grayscale', 'gutenberg' ), + 'purple-yellow' => __( 'Purple and yellow', 'gutenberg' ), + 'blue-red' => __( 'Blue and red', 'gutenberg' ), + 'midnight' => __( 'Midnight', 'gutenberg' ), + 'magenta-yellow' => __( 'Magenta and yellow', 'gutenberg' ), + 'purple-green' => __( 'Purple and green', 'gutenberg' ), + 'blue-orange' => __( 'Blue and orange', 'gutenberg' ), + ); + if ( ! empty( $config['global']['settings']['color']['duotone'] ) ) { + foreach ( $config['global']['settings']['color']['duotone'] as &$gradient ) { + $gradient['name'] = $default_duotone_i18n[ $gradient['slug'] ]; + } + } + $default_font_sizes_i18n = array( 'small' => __( 'Small', 'gutenberg' ), 'normal' => __( 'Normal', 'gutenberg' ), diff --git a/lib/class-wp-theme-json.php b/lib/class-wp-theme-json.php index 107ef3d3f6a757..becdacc066d05c 100644 --- a/lib/class-wp-theme-json.php +++ b/lib/class-wp-theme-json.php @@ -149,6 +149,7 @@ class WP_Theme_JSON { 'gradients' => null, 'link' => null, 'palette' => null, + 'duotone' => null, ), 'spacing' => array( 'customPadding' => null, diff --git a/lib/duotone-filter.php b/lib/duotone-filter.php new file mode 100644 index 00000000000000..ea3a3bf3bd970f --- /dev/null +++ b/lib/duotone-filter.php @@ -0,0 +1,59 @@ + + + + + + + + + values=".299 .587 .114 0 0 + .299 .587 .114 0 0 + .299 .587 .114 0 0 + 0 0 0 1 0" + + /> + + + + + + + + + + + + + + + + + + + + + + +