PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | admin/metabox/class-metabox-editor.php +17 -0 18.6 → trunk View file →
@@ -13,11 +13,18 @@
13 13 /**
14 14 * Registers hooks to WordPress.
15 15 *
16 16 * @codeCoverageIgnore
17 + *
18 + * @return void
17 19 */
18 20 public function register_hooks() {
21 + // For the Classic editor.
19 22 add_filter( 'mce_css', [ $this, 'add_css_inside_editor' ] );
23 + // For the Block/Gutenberg editor.
24 + // See https://github.com/danielbachhuber/gutenberg-migration-guide/blob/master/filter-mce-css.md.
25 + add_action( 'enqueue_block_editor_assets', [ $this, 'add_editor_styles' ] );
26 +
20 27 add_filter( 'tiny_mce_before_init', [ $this, 'add_custom_element' ] );
21 28 }
22 29
23 30 /**
@@ -41,8 +48,18 @@
41 48 $css_files .= ',' . $url;
42 49 }
43 50
44 51 return $css_files;
52 + }
53 +
54 + /**
55 + * Enqueues the CSS to use in the TinyMCE editor.
56 + *
57 + * @return void
58 + */
59 + public function add_editor_styles() {
60 + $asset_manager = new WPSEO_Admin_Asset_Manager();
61 + $asset_manager->enqueue_style( 'inside-editor' );
45 62 }
46 63
47 64 /**
48 65 * Adds a custom element to the tinyMCE editor that we need for marking the content.