PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.5
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.5
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 +34 -0 28.028.5 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 */
@@ -426,8 +448,20 @@
426 448 return \sanitize_text_field( \wp_unslash( $_GET['page'] ) );
427 449 }
428 450
429 451 return '';
452 + }
453 +
454 + /**
455 + * Returns whether the current admin overview (list table) shows the trash.
456 + *
457 + * Mirrors the check WP_Posts_List_Table itself uses to decide it is on the trash view.
458 + *
459 + * @return bool Whether the current admin overview shows the trash.
460 + */
461 + public function is_trash_overview(): bool {
462 + // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Reason: We are not processing form information.
463 + return isset( $_REQUEST['post_status'] ) && $_REQUEST['post_status'] === 'trash';
430 464 }
431 465
432 466 /**
433 467 * Checks if the current global post is the privacy policy page.