id, self::SCREENS, true ) && ! self::is_dismissed(); } public static function is_dismissed() { $dismissed = get_option( self::OPTION_KEY, [] ); return is_array( $dismissed ) && in_array( self::BIGGOPTI_ID, $dismissed, true ); } private static function dismiss() { $dismissed = get_option( self::OPTION_KEY, [] ); $dismissed = is_array( $dismissed ) ? $dismissed : []; if ( ! in_array( self::BIGGOPTI_ID, $dismissed, true ) ) { $dismissed[] = self::BIGGOPTI_ID; update_option( self::OPTION_KEY, $dismissed ); } } public static function render() { if ( ! self::should_show() ) { return; } $nonce = wp_create_nonce( self::ACTION ); $screen = get_current_screen(); $classes = 'notice notice-info bdthemes-deals-biggopti'; // WordPress moves notices below the first heading in .wrap. On the plugin // dashboards that heading belongs to the plugin's own (often React) UI, so // keep the biggopti where it is printed, above that UI. if ( ! in_array( $screen->id, [ 'dashboard', 'plugins' ], true ) ) { $classes .= ' inline'; } $skip_url = add_query_arg( [ self::ACTION => self::BIGGOPTI_ID, '_wpnonce' => $nonce, ] ); ?>