: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Static function that wraps WordPress utility functions for WordPress pages.
* Return true if the current page has Gutenberg active.
public static function is_gutenberg_page() {
if ( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {
// The Gutenberg plugin is on.
$current_screen = get_current_screen();
if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
* Return true if the current page is the WP Admin dashboard.
public static function is_dashboard() {
$screen = get_current_screen();
return 'dashboard' === $screen->id;