Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Duotone changes #4619

Closed
wants to merge 47 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
69b6154
BP: Duotone: Limit SVG filter output to used filters #49103
MaggieCabrera Jun 15, 2023
26ee6d3
wrong place for the included file
MaggieCabrera Jun 15, 2023
4615585
BP: Duotone: Remove Safari rerender hack (#49232)
MaggieCabrera Jun 15, 2023
984486c
BP: Replace regex with tag processor for duotone class render #49212
MaggieCabrera Jun 15, 2023
72f6355
BP: Duotone: Pass filters to the Post Editor #49239
MaggieCabrera Jun 15, 2023
cb980d0
BP: Port colord to PHP #49700
MaggieCabrera Jun 15, 2023
b6f01c6
BP:Deprecate remaining global duotone functions
MaggieCabrera Jun 15, 2023
035a100
BP - partially: Selectors API: Fix for global styles hook, style vari…
MaggieCabrera Jun 15, 2023
83e3c2a
BP - partially: Selectors API: Make duotone selectors fallback and be…
MaggieCabrera Jun 15, 2023
3777e20
BP: Group duotone outputs and refactor rendering #49705
MaggieCabrera Jun 15, 2023
3471457
BP: Polish duotone rendering code #49706
MaggieCabrera Jun 15, 2023
e82e5da
BP: Better error message when theme.json styles use a duotone preset …
MaggieCabrera Jun 15, 2023
89d1c7a
BP: Clarify error message if duotone color values is incorrect #51397
MaggieCabrera Jun 15, 2023
8efbc43
run linter
MaggieCabrera Jun 15, 2023
8dc7158
Add duotone hooks
Jun 15, 2023
9774f6c
Fix comments to reference core versions of functions
Jun 15, 2023
ee7741c
Fix more comments to reference core versions of functions
Jun 15, 2023
4d1d9aa
Use core versions of classes/functions
Jun 15, 2023
9ebb0d3
Remove gutenberg translation domains
Jun 15, 2023
2a90a43
added docs or fixed them
MaggieCabrera Jun 16, 2023
2fd1bf9
Fixed more docblocks
MaggieCabrera Jun 21, 2023
d2306db
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
fb75344
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
f78d01b
Update tests/phpunit/tests/block-supports/duotone.php
MaggieCabrera Jun 26, 2023
7106f33
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
4530c53
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
071e093
fix docblocks for tests
MaggieCabrera Jun 26, 2023
eb1c12e
fix multiline comments
MaggieCabrera Jun 26, 2023
956e65c
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
6dad8db
fix colord functions docblocks
MaggieCabrera Jun 26, 2023
f1c26ea
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
49f0630
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
7d296b4
Update src/wp-includes/class-wp-duotone.php
MaggieCabrera Jun 26, 2023
e18f0ae
moved deprecated functions to the correct file
MaggieCabrera Jun 26, 2023
ae122da
Mark private and new deprecated methods as internal
ajlende Jun 26, 2023
6a91d93
Format line wrapping in comment
ajlende Jun 26, 2023
5141c6a
Update deprecated function docblock link and order
ajlende Jun 26, 2023
ec248c2
Fix trailing space
ajlende Jun 26, 2023
375ce41
Add more description to the WP_Duotone methods
ajlende Jun 26, 2023
895363a
Deprecate wp_global_styles_render_svg_filters and wp_get_global_style…
ajlende Jun 27, 2023
5347e2c
Remove tests for deprecated functions
ajlende Jun 27, 2023
1476cff
Move newly deprecated functions to deprecated.php
ajlende Jun 27, 2023
d74a917
Add changelog to PRESETS_METADATA
ajlende Jun 27, 2023
710858d
Add @since 6.3.0 to all duotone methods
ajlende Jun 27, 2023
a114db1
Mark class WP_Duotone as @access private
ajlende Jun 27, 2023
105bd9e
Fix theme json test string
tellthemachines Jun 28, 2023
2541786
Fix lint error
tellthemachines Jun 28, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
580 changes: 23 additions & 557 deletions src/wp-includes/block-supports/duotone.php

Large diffs are not rendered by default.

1,274 changes: 1,274 additions & 0 deletions src/wp-includes/class-wp-duotone.php

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/wp-includes/class-wp-theme-json.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ class WP_Theme_JSON {
* @since 6.0.0 Replaced `override` with `prevent_override` and updated the
* `prevent_override` value for `color.duotone` to use `color.defaultDuotone`.
* @since 6.2.0 Added 'shadow' presets.
* @since 6.3.0 Replaced value_func for duotone with `null`. Custom properties are handled by class-wp-duotone.php.
* @var array
*/
const PRESETS_METADATA = array(
Expand Down Expand Up @@ -143,8 +144,8 @@ class WP_Theme_JSON {
'path' => array( 'color', 'duotone' ),
'prevent_override' => array( 'color', 'defaultDuotone' ),
'use_default_names' => false,
'value_func' => 'wp_get_duotone_filter_property',
'css_vars' => '--wp--preset--duotone--$slug',
'value_func' => null, // CSS Custom Properties for duotone are handled by block supports in class-wp-duotone.php.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested annotation for docblock

* @since 6.3.0 Replaced value_func for duoone with null. Custom properties are handled by class-wp-duotone.php.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 3265f93

'css_vars' => null,
'classes' => array(),
'properties' => array( 'filter' ),
),
Expand Down
4 changes: 0 additions & 4 deletions src/wp-includes/default-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,10 +606,6 @@
add_action( 'wp_enqueue_scripts', 'wp_enqueue_stored_styles' );
add_action( 'wp_footer', 'wp_enqueue_stored_styles', 1 );

// SVG filters like duotone have to be loaded at the beginning of the body in both admin and the front-end.
add_action( 'wp_body_open', 'wp_global_styles_render_svg_filters' );
add_action( 'in_admin_header', 'wp_global_styles_render_svg_filters' );

add_action( 'wp_default_styles', 'wp_default_styles' );
add_filter( 'style_loader_src', 'wp_style_loader_src', 10, 2 );

Expand Down
Loading