: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* The class provides utility functions related to check condition related to plugin.
* @author Advanced Ads <info@wpadvancedads.com>
namespace AdvancedAds\Utilities;
use AdvancedAds\Framework\Utilities\Params;
defined( 'ABSPATH' ) || exit;
* Check if the current screen belongs to Advanced Ads
public static function is_screen_advanced_ads(): bool {
if ( ! function_exists( 'get_current_screen' ) ) {
$screen = get_current_screen();
if ( ! isset( $screen->id ) ) {
return in_array( $screen->id, Data::get_admin_screen_ids(), true );
* Check if the current screen uses a search or filter.
public static function has_filter_or_search(): bool {
$params = [ 's', 'adtype', 'adsize', 'adgroup' ];
foreach ( $params as $param ) {
if ( ! empty( Params::get( $param ) ) ) {