wppaste
WordPress

WP_Duotone

Source
wp-includes/class-wp-duotone.php:40
Manages duotone block supports and global styles.

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0).

Properties · 5

$global_styles_block_names?arrayprivate static
Block names from global, theme, and custom styles that use duotone presets and the slug of the preset they are using.
$global_styles_presets?arrayprivate static
An array of duotone filter data from global, theme, and custom presets.
$used_global_styles_presetsarrayprivate static
All of the duotone filter data from presets for CSS custom properties on the page.
$used_svg_filter_dataarrayprivate static
All of the duotone filter data for SVGs on the page. Includes both presets and custom filters.
$block_css_declarationsarrayprivate static
All of the block CSS declarations for styles on the page.

Methods · 38

Source code

class WP_Duotone {	/**	 * Block names from global, theme, and custom styles that use duotone presets and the slug of	 * the preset they are using.	 *	 * Example:	 *  [	 *      'core/featured-image' => 'blue-orange',	 *       …	 *  ]	 *	 * @internal	 *	 * @since 6.3.0	 *	 * @var ?array	 */	private static $global_styles_block_names; 	/**	 * An array of duotone filter data from global, theme, and custom presets.	 *	 * Example:	 *  [	 *      'wp-duotone-blue-orange' => [	 *          'slug'  => 'blue-orange',	 *          'colors' => [ '#0000ff', '#ffcc00' ],	 *      ],	 *      'wp-duotone-red-yellow' => [	 *          'slug'   => 'red-yellow',	 *          'colors' => [ '#cc0000', '#ffff33' ],	 *      ],	 *      …	 *  ]	 *	 * @internal	 *	 * @since 6.3.0	 *	 * @var ?array	 */	private static $global_styles_presets; 	/**	 * All of the duotone filter data from presets for CSS custom properties on	 * the page.	 *	 * Example:	 *  [	 *      'wp-duotone-blue-orange' => [	 *          'slug'   => 'blue-orange',	 *          'colors' => [ '#0000ff', '#ffcc00' ],	 *      ],	 *      …	 *  ]	 *	 * @internal	 *	 * @since 6.3.0	 *	 * @var array	 */	private static $used_global_styles_presets = array(); 	/**	 * All of the duotone filter data for SVGs on the page. Includes both	 * presets and custom filters.	 *	 * Example:	 *  [	 *      'wp-duotone-blue-orange' => [	 *          'slug'   => 'blue-orange',	 *          'colors' => [ '#0000ff', '#ffcc00' ],	 *      ],	 *      'wp-duotone-000000-ffffff-2' => [	 *          'slug'   => '000000-ffffff-2',	 *          'colors' => [ '#000000', '#ffffff' ],	 *      ],	 *	 *  ]

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-duotone.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.