Changeset 52757 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 02/17/2022 04:16:59 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r52744 r52757 133 133 'override' => true, 134 134 'use_default_names' => false, 135 'value_func' => 'wp_ render_duotone_filter_preset',135 'value_func' => 'wp_get_duotone_filter_property', 136 136 'css_vars' => '--wp--preset--duotone--$slug', 137 137 'classes' => array(), … … 1588 1588 1589 1589 /** 1590 * Converts all filter (duotone) presets into SVGs. 1591 * 1592 * @since 5.9.1 1593 * 1594 * @param array $origins List of origins to process. 1595 * @return string SVG filters. 1596 */ 1597 public function get_svg_filters( $origins ) { 1598 $blocks_metadata = static::get_blocks_metadata(); 1599 $setting_nodes = static::get_setting_nodes( $this->theme_json, $blocks_metadata ); 1600 1601 foreach ( $setting_nodes as $metadata ) { 1602 $node = _wp_array_get( $this->theme_json, $metadata['path'], array() ); 1603 if ( empty( $node['color']['duotone'] ) ) { 1604 continue; 1605 } 1606 1607 $duotone_presets = $node['color']['duotone']; 1608 1609 $filters = ''; 1610 foreach ( $origins as $origin ) { 1611 if ( ! isset( $duotone_presets[ $origin ] ) ) { 1612 continue; 1613 } 1614 foreach ( $duotone_presets[ $origin ] as $duotone_preset ) { 1615 $filters .= wp_get_duotone_filter_svg( $duotone_preset ); 1616 } 1617 } 1618 } 1619 1620 return $filters; 1621 } 1622 1623 /** 1590 1624 * Returns whether a presets should be overridden or not. 1591 1625 *
Note: See TracChangeset
for help on using the changeset viewer.