Changes between Initial Version and Version 2 of Ticket #58467
- Timestamp:
- 06/06/2023 11:32:51 AM (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #58467 – Description
initial v2 6 6 - Paste the following under `styles.blocks`: 7 7 8 ```json 8 9 {{{ 9 10 "core/post-terms": { 10 11 "typography": { "fontSize": "var(--wp--preset--font-size--small)" }, 11 12 "color":{ "background": "var:preset|color|secondary" } 12 13 } 13 ``` 14 }}} 14 15 - Use the `wp_get_global_styles` functions to retrieve those styles. For example, paste the following in `functions.php` of the theme: 15 16 16 ```php 17 18 {{{#!php 19 <?php 17 20 add_action( 'init', function(){ 18 21 error_log( print_r( wp_get_global_styles( array(), array('block_name'=>'core/post-terms') ), true ) ); 19 22 } ); 20 ``` 23 24 }}} 25 21 26 22 27 The result will be: 23 28 24 ```php 29 30 {{{#!php 31 <?php 25 32 ( 26 33 [typography] => Array( [fontSize] => var(--wp--preset--font-size--small) ) 27 34 [color] => Array( [background] => var:preset|color|secondary ) 28 35 ) 29 ``` 36 37 }}} 38 30 39 31 40 when it should have been 32 41 33 ```php 42 43 {{{#!php 44 <?php 34 45 ( 35 46 [typography] => Array( [fontSize] => var(--wp--preset--font-size--small) ) 36 47 [color] => Array( [background] => var(--wp--preset--color--secondary) ) 37 48 ) 38 ``` 49 50 }}} 39 51 40 52 Note the `color.background` value. It should return the value in the standard CSS Custom Property format, not the shortened internal format.