Make WordPress Core

Changeset 53208


Ignore:
Timestamp:
04/18/2022 05:10:17 PM (3 years ago)
Author:
jorgefilipecosta
Message:

Block editor: Prevent styles from being added in the site editor.

The site editor, unlike other editors, generates the styles coming from global styles (presets, styles) dynamically in the client. This is because the user can modify any value that we need to consolidate (merge core, theme, and user style preferences). We don't want to have the global styles twice, as it introduces subtle bugs.

Props oandregal, youknowriad.
See #55567.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-editor.php

    r53160 r53208  
    384384            'css'            => 'variables',
    385385            '__unstableType' => 'presets',
     386            'isGlobalStyles' => true,
    386387        ),
    387388        array(
    388389            'css'            => 'presets',
    389390            '__unstableType' => 'presets',
     391            'isGlobalStyles' => true,
    390392        ),
    391393    );
     
    402404            'css'            => 'styles',
    403405            '__unstableType' => 'theme',
     406            'isGlobalStyles' => true,
    404407        );
    405408        $actual_css    = wp_get_global_stylesheet( array( $block_classes['css'] ) );
     
    629632                        'css'            => wp_remote_retrieve_body( $response ),
    630633                        '__unstableType' => 'theme',
     634                        'isGlobalStyles' => false,
    631635                    );
    632636                }
     
    638642                        'baseURL'        => get_theme_file_uri( $style ),
    639643                        '__unstableType' => 'theme',
     644                        'isGlobalStyles' => false,
    640645                    );
    641646                }
Note: See TracChangeset for help on using the changeset viewer.