Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add @SInCE 6.3.0 to all duotone methods
  • Loading branch information
ajlende authored and tellthemachines committed Jun 29, 2023
commit 710858d48505626dfdad50678181d3ef4e23fd67
60 changes: 60 additions & 0 deletions src/wp-includes/class-wp-duotone.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ class WP_Duotone {
*
* @internal
*
* @since 6.3.0
*
* @var array
*/
private static $global_styles_block_names = array();
Expand All @@ -72,6 +74,8 @@ class WP_Duotone {
*
* @internal
*
* @since 6.3.0
*
* @var array
*/
private static $global_styles_presets = array();
Expand All @@ -91,6 +95,8 @@ class WP_Duotone {
*
* @internal
*
* @since 6.3.0
*
* @var array
*/
private static $used_global_styles_presets = array();
Expand All @@ -114,6 +120,8 @@ class WP_Duotone {
*
* @internal
*
* @since 6.3.0
*
* @var array
*/
private static $used_svg_filter_data = array();
Expand All @@ -134,6 +142,8 @@ class WP_Duotone {
*
* @internal
*
* @since 6.3.0
*
* @var array
*/
private static $block_css_declarations = array();
Expand All @@ -147,6 +157,8 @@ class WP_Duotone {
*
* @internal
*
* @since 6.3.0
*
* @param float $number The number to clamp.
* @param float $min The minimum value.
* @param float $max The maximum value.
Expand All @@ -165,6 +177,8 @@ private static function colord_clamp( $number, $min = 0, $max = 1 ) {
*
* @internal
*
* @since 6.3.0
*
* @param float $degrees The hue to clamp.
* @return float The clamped hue.
*/
Expand All @@ -182,6 +196,8 @@ private static function colord_clamp_hue( $degrees ) {
*
* @internal
*
* @since 6.3.0
*
* @param float $value The hue value to parse.
* @param string $unit The unit of the hue value.
* @return float The parsed hue value.
Expand Down Expand Up @@ -210,6 +226,8 @@ private static function colord_parse_hue( $value, $unit = 'deg' ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $hex The hex string to parse.
* @return array|null An array of RGBA values or null if the hex string is invalid.
*/
Expand Down Expand Up @@ -256,6 +274,8 @@ private static function colord_parse_hex( $hex ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $rgba The RGBA array to clamp.
* @return array The clamped RGBA array.
*/
Expand All @@ -277,6 +297,8 @@ private static function colord_clamp_rgba( $rgba ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $input The RGBA string to parse.
* @return array|null An array of RGBA values or null if the RGB string is invalid.
*/
Expand Down Expand Up @@ -334,6 +356,8 @@ private static function colord_parse_rgba_string( $input ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $hsla The HSLA array to clamp.
* @return array The clamped HSLA array.
*/
Expand All @@ -355,6 +379,8 @@ private static function colord_clamp_hsla( $hsla ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $hsva The HSVA array to convert.
* @return array The RGBA array.
*/
Expand Down Expand Up @@ -387,6 +413,8 @@ private static function colord_hsva_to_rgba( $hsva ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $hsla The HSLA array to convert.
* @return array The HSVA array.
*/
Expand Down Expand Up @@ -415,6 +443,8 @@ private static function colord_hsla_to_hsva( $hsla ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $hsla The HSLA array to convert.
* @return array The RGBA array.
*/
Expand All @@ -431,6 +461,8 @@ private static function colord_hsla_to_rgba( $hsla ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $input The HSLA string to parse.
* @return array|null An array of RGBA values or null if the RGB string is invalid.
*/
Expand Down Expand Up @@ -487,6 +519,8 @@ private static function colord_parse_hsla_string( $input ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $input The string to parse.
* @return array|null An array of RGBA values or null if the string is invalid.
*/
Expand All @@ -513,6 +547,8 @@ private static function colord_parse( $input ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $duotone_attr The duotone attribute from a block.
* @return string The slug of the duotone preset or an empty string if no slug is found.
*/
Expand All @@ -530,6 +566,8 @@ private static function get_slug_from_attribute( $duotone_attr ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $duotone_attr The duotone attribute from a block.
* @return bool True if the duotone preset present and valid.
*/
Expand All @@ -548,6 +586,8 @@ private static function is_preset( $duotone_attr ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $slug The slug of the duotone preset.
* @return string The CSS variable name.
*/
Expand All @@ -563,6 +603,8 @@ private static function get_css_custom_property_name( $slug ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $slug The slug of the duotone preset.
* @return string The ID of the duotone filter.
*/
Expand All @@ -578,6 +620,8 @@ private static function get_filter_id( $slug ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $slug The slug of the duotone preset.
* @return string The CSS variable.
*/
Expand All @@ -594,6 +638,8 @@ private static function get_css_var( $slug ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $filter_id The ID of the filter.
* @return string The URL for the duotone filter.
*/
Expand All @@ -608,6 +654,8 @@ private static function get_filter_url( $filter_id ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $filter_id The ID of the filter.
* @param array $colors An array of color strings.
* @return string An SVG with a duotone filter definition.
Expand Down Expand Up @@ -739,6 +787,8 @@ public static function get_filter_svg_from_preset( $preset ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $sources The duotone presets.
* @return string The SVGs for the duotone filters.
*/
Expand All @@ -759,6 +809,8 @@ private static function get_svg_definitions( $sources ) {
*
* @internal
*
* @since 6.3.0
*
* @param array $sources The duotone presets.
* @return string The CSS for global styles.
*/
Expand All @@ -782,6 +834,8 @@ private static function get_global_styles_presets( $sources ) {
*
* @internal
*
* @since 6.3.0
*
* @param string $filter_id The filter ID. e.g. 'wp-duotone-000000-ffffff-2'.
* @param string $duotone_selector The block's duotone selector. e.g. '.wp-block-image img'.
* @param string $filter_value The filter CSS value. e.g. 'url(#wp-duotone-000000-ffffff-2)' or 'unset'.
Expand Down Expand Up @@ -817,6 +871,8 @@ private static function enqueue_block_css( $filter_id, $duotone_selector, $filte
*
* @internal
*
* @since 6.3.0
*
* @param string $filter_id The filter ID. e.g. 'wp-duotone-000000-ffffff-2'.
* @param string $duotone_selector The block's duotone selector. e.g. '.wp-block-image img'.
* @param string $filter_value The filter CSS value. e.g. 'url(#wp-duotone-000000-ffffff-2)' or 'unset'.
Expand All @@ -834,6 +890,8 @@ private static function enqueue_custom_filter( $filter_id, $duotone_selector, $f
*
* @internal
*
* @since 6.3.0
*
* @param string $filter_id The filter ID. e.g. 'wp-duotone-blue-orange'.
* @param string $duotone_selector The block's duotone selector. e.g. '.wp-block-image img'.
* @param string $filter_value The filter CSS value. e.g. 'url(#wp-duotone-blue-orange)' or 'unset'.
Expand Down Expand Up @@ -894,6 +952,8 @@ public static function register_duotone_support( $block_type ) {
*
* @internal
*
* @since 6.3.0
*
* @return string The CSS selector or null if there is no support.
*/
private static function get_selector( $block_name ) {
Expand Down