Skip to content

Commit

Permalink
Consolidate overall Global Styles mechanics in the server (#20047)
Browse files Browse the repository at this point in the history
  • Loading branch information
nosolosw authored Feb 14, 2020
1 parent 7924f06 commit d870797
Show file tree
Hide file tree
Showing 5 changed files with 295 additions and 79 deletions.
10 changes: 4 additions & 6 deletions experimental-default-global-styles.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"global": {
"color": {
"primary": "#52accc",
"background": "white",
"text": "black"
}
"color": {
"primary": "#52accc",
"background": "white",
"text": "black"
}
}
5 changes: 5 additions & 0 deletions lib/edit-site-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ function gutenberg_edit_site_init( $hook ) {
apply_filters( 'template_include', null );
$settings['templateId'] = $_wp_current_template_id;

// This is so other parts of the code can hook their own settings.
// Example: Global Styles.
global $post;
$settings = apply_filters( 'block_editor_settings', $settings, $post );

// Initialize editor.
wp_add_inline_script(
'wp-edit-site',
Expand Down
Loading

0 comments on commit d870797

Please sign in to comment.