diff --git a/admin/class-admin-asset-manager.php b/admin/class-admin-asset-manager.php index 3cbdc3488df..cc67abf57c7 100644 --- a/admin/class-admin-asset-manager.php +++ b/admin/class-admin-asset-manager.php @@ -635,7 +635,11 @@ protected function styles_to_be_registered() { [ 'name' => 'structured-data-blocks', 'src' => 'structured-data-blocks-' . $flat_version, - 'deps' => [ 'wp-edit-blocks' ], + 'deps' => [ + 'dashicons', + 'forms', + 'wp-edit-blocks', + ], ], [ 'name' => 'elementor', diff --git a/css/src/structured-data-blocks.css b/css/src/structured-data-blocks.css index f7759c683ad..e71f89afc44 100644 --- a/css/src/structured-data-blocks.css +++ b/css/src/structured-data-blocks.css @@ -93,6 +93,12 @@ text-align: right; } +.schema-how-to-duration { + border: 0; + padding: 0; + margin: 0; +} + .schema-how-to-duration-flex-container { display: flex; align-items: center; diff --git a/src/integrations/blocks/structured-data-blocks.php b/src/integrations/blocks/structured-data-blocks.php index 5b90bd65770..9b65cf2434c 100644 --- a/src/integrations/blocks/structured-data-blocks.php +++ b/src/integrations/blocks/structured-data-blocks.php @@ -69,7 +69,7 @@ public function __construct( * @return void */ public function register_hooks() { - \add_action( 'enqueue_block_editor_assets', [ $this, 'enqueue_block_editor_assets' ] ); + \add_action( 'enqueue_block_assets', [ $this, 'enqueue_block_editor_assets' ] ); $this->register_blocks(); } @@ -148,6 +148,11 @@ public function register_blocks() { * @return void */ public function enqueue_block_editor_assets() { + // Bail if not in the admin. + if ( ! \is_admin() ) { + return; + } + /** * Filter: 'wpseo_enable_structured_data_blocks' - Allows disabling Yoast's schema blocks entirely. *