Skip to content

Commit

Permalink
[edit-widgets] Simplify gutenberg_widgets_init when $hook === 'widget…
Browse files Browse the repository at this point in the history
…s.php' (#24793)

* Simplify gutenberg_widgets_init when $hook === 'widgets.php'

* Add a theme css

* Lint
  • Loading branch information
adamziel authored Aug 26, 2020
1 parent e4fc5de commit df95a75
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/widgets-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ class="blocks-widgets-container
* @param string $hook Page.
*/
function gutenberg_widgets_init( $hook ) {
if ( ! in_array( $hook, array( 'gutenberg_page_gutenberg-widgets', 'gutenberg_customizer', 'widgets.php' ), true ) ) {
if ( 'widgets.php' === $hook ) {
wp_enqueue_style( 'wp-block-library' );
wp_enqueue_style( 'wp-block-library-theme' );
return;
}
if ( ! in_array( $hook, array( 'gutenberg_page_gutenberg-widgets', 'gutenberg_customizer' ), true ) ) {
return;
}

Expand Down

0 comments on commit df95a75

Please sign in to comment.