Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 792afe9

Browse files
authored
Remove work-around to load our stylesheets after wp-edit-post (#4097)
1 parent 4c86da4 commit 792afe9

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

src/AssetsController.php

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ protected function init() {
3737
add_action( 'init', array( $this, 'register_assets' ) );
3838
add_action( 'body_class', array( $this, 'add_theme_body_class' ), 1 );
3939
add_action( 'admin_body_class', array( $this, 'add_theme_body_class' ), 1 );
40-
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
41-
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
4240
}
4341

4442
/**
4543
* Register block scripts & styles.
4644
*/
4745
public function register_assets() {
46+
$this->register_style( 'wc-block-vendors-style', plugins_url( $this->api->get_block_asset_build_path( 'vendors-style', 'css' ), __DIR__ ) );
4847
$this->register_style( 'wc-block-editor', plugins_url( $this->api->get_block_asset_build_path( 'editor', 'css' ), __DIR__ ), array( 'wp-edit-blocks' ) );
4948
$this->register_style( 'wc-block-style', plugins_url( $this->api->get_block_asset_build_path( 'style', 'css' ), __DIR__ ), array( 'wc-block-vendors-style' ) );
5049

@@ -76,17 +75,6 @@ public function register_assets() {
7675
);
7776
}
7877

79-
/**
80-
* Register the vendors style file. We need to do it after the other files
81-
* because we need to check if `wp-edit-post` has been enqueued.
82-
*/
83-
public function enqueue_scripts() {
84-
// @todo Remove fix to load our stylesheets after editor CSS.
85-
// See #3068 and #3898 for the rationale of this fix. It should be no
86-
// longer necessary when the editor is loaded in an iframe (https://github.com/WordPress/gutenberg/issues/20797).
87-
$this->register_style( 'wc-block-vendors-style', plugins_url( $this->api->get_block_asset_build_path( 'vendors-style', 'css' ), __DIR__ ), wp_style_is( 'wp-edit-post' ) ? [ 'wp-edit-post' ] : [] );
88-
}
89-
9078
/**
9179
* Add body classes to the frontend and within admin.
9280
*

0 commit comments

Comments
 (0)