Skip to content

Commit

Permalink
Add way for additional styles to be added to editor.
Browse files Browse the repository at this point in the history
Fixes #422.  Added an action so that someone could hook into where
gutenberg styles are loaded and bring in an editor style of their own.
I took this approach, as there is not a super clean way to mimic
`add_editor_style()` without adding another global variable to
WordPress, without PHP 5.3+, that I could find.
  • Loading branch information
BE-Webdesign committed Apr 26, 2017
1 parent f58fea4 commit 6217408
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,17 @@ function gutenberg_scripts_and_styles( $hook ) {
plugins_url( 'editor/build/style.css', __FILE__ ),
array( 'wp-blocks' )
);

/**
* Fires after base styles have been enqueued for Gutenberg.
*
* Make sure to `add_action()` on any hook before 'admin_enqueue_scripts'
* In the function call you supply, simply use wp_enqueue_style() to add
* additional styles to the gutenberg editor.
*
* @since 0.1.0
*/
do_action( 'enqueue_gutenberg_editor_styles' );
}
add_action( 'admin_enqueue_scripts', 'gutenberg_scripts_and_styles' );

Expand Down

0 comments on commit 6217408

Please sign in to comment.