diff --git a/lib/global-styles.php b/lib/global-styles.php index c385b72f18bca..32ae21e442110 100644 --- a/lib/global-styles.php +++ b/lib/global-styles.php @@ -432,7 +432,7 @@ function gutenberg_experimental_global_styles_get_support_keys() { * @return array Presets structure */ function gutenberg_experimental_global_styles_get_presets_structure() { - return array( + $structure = array( 'color' => array( 'path' => array( 'color', 'palette' ), 'key' => 'color', @@ -446,6 +446,13 @@ function gutenberg_experimental_global_styles_get_presets_structure() { 'key' => 'size', ), ); + + /** + * Filter the global styles presets structure. + * + * @param array $structure The structure array. + */ + return apply_filters( 'global_styles_get_presets_structure', $structure ); } /** @@ -552,7 +559,12 @@ function gutenberg_experimental_global_styles_get_block_data() { } } - return $block_data; + /** + * Filter the global styles array for blocks. + * + * @param array $block_data The block-data array. + */ + return apply_filters( 'global_styles_get_block_data', $block_data ); } /** @@ -644,7 +656,12 @@ function gutenberg_experimental_global_styles_get_stylesheet( $tree ) { $stylesheet .= 'a{color:var(--wp--style--color--link, #00e);}'; } - return $stylesheet; + /** + * Filter the generated styles. + * + * @param string $stylesheet The generated CSS. + */ + return apply_filters( 'global_styles_get_stylesheet', $stylesheet ); } /**