Make WordPress Core

Changes between Initial Version and Version 2 of Ticket #58467


Ignore:
Timestamp:
06/06/2023 11:32:51 AM (6 months ago)
Author:
oandregal
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #58467 – Description

    initial v2  
    66- Paste the following under `styles.blocks`:
    77
    8 ```json
     8
     9{{{
    910"core/post-terms": {
    1011    "typography": { "fontSize": "var(--wp--preset--font-size--small)" },
    1112    "color":{ "background": "var:preset|color|secondary" }
    1213}
    13 ```
     14}}}
    1415- Use the `wp_get_global_styles` functions to retrieve those styles. For example, paste the following in `functions.php` of the theme:
    1516
    16 ```php
     17
     18{{{#!php
     19<?php
    1720add_action( 'init', function(){
    1821        error_log( print_r( wp_get_global_styles( array(), array('block_name'=>'core/post-terms') ), true ) );
    1922} );
    20 ```
     23
     24}}}
     25
    2126
    2227The result will be:
    2328
    24 ```php
     29
     30{{{#!php
     31<?php
    2532(
    2633    [typography] => Array( [fontSize] => var(--wp--preset--font-size--small) )
    2734    [color] => Array( [background] => var:preset|color|secondary )
    2835)
    29 ```
     36
     37}}}
     38
    3039
    3140when it should have been
    3241
    33 ```php
     42
     43{{{#!php
     44<?php
    3445(
    3546    [typography] => Array( [fontSize] => var(--wp--preset--font-size--small) )
    3647    [color] => Array( [background] => var(--wp--preset--color--secondary) )
    3748)
    38 ```
     49
     50}}}
    3951
    4052Note the `color.background` value. It should return the value in the standard CSS Custom Property format, not the shortened internal format.