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 | src/helpers/current-page-helper.php +22 -0 28.4 → trunk View file →
@@ -398,8 +398,30 @@
398 398 return $pagenow;
399 399 }
400 400
401 401 /**
402 + * Determines whether the current admin screen is the block editor.
403 + *
404 + * Deliberately uses get_current_screen() and not WP_Screen::get(): the latter re-applies
405 + * the replace_editor filter on every call, which is a render hook with side effects
406 + * (e.g. it breaks the WooCommerce block email editor).
407 + *
408 + * Only reliable after set_current_screen() has run (during admin page load, after
409 + * admin_init); earlier calls return false.
410 + *
411 + * @return bool Whether the current screen is the block editor.
412 + */
413 + public function is_block_editor() {
414 + if ( ! \function_exists( 'get_current_screen' ) ) {
415 + return false;
416 + }
417 +
418 + $screen = \get_current_screen();
419 +
420 + return $screen !== null && $screen->is_block_editor();
421 + }
422 +
423 + /**
402 424 * Check if the current opened page is a Yoast SEO page.
403 425 *
404 426 * @return bool True when current page is a yoast seo plugin page.
405 427 */