init(); } return self::$instance; } /** * Drop-in actions */ public function init() { add_action( 'admin_notices', array( $this, 'admin_notice' ), defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : 99999 ); //phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound add_action( 'admin_init', array( $this, 'remove_notice' ), defined( 'PHP_INT_MIN' ) ? PHP_INT_MIN : 99999 ); //phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound } /** * Remove notice; */ public function remove_notice() { if ( ! isset( $_GET[ self::$dismiss_key ] ) ) { return; } if ( $_GET[ self::$dismiss_key ] !== 'yes' ) { return; } if ( ! isset( $_GET['remove_upsell'] ) ) { return; } if ( ! wp_verify_nonce( $_GET['remove_upsell'], 'remove_upsell_confirmation' ) ) { //phpcs:ignore WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized return; } update_option( self::$dismiss_key, 'yes' ); } /** * Add notice. */ public function admin_notice() { if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) { return; } if ( is_network_admin() ) { return; } if ( ! current_user_can( 'manage_options' ) ) { return; } if ( get_option( self::$dismiss_key, 'no' ) === 'yes' ) { return; } $theme = wp_get_theme(); if ( $theme->get( 'Name' ) === 'Neve' ) { return; } // Dont show the notice if the plugin is recently installed. $plugin_installed = get_option( 'themeisle_companion_install', '' ); if ( empty( $plugin_installed ) || ( time() - intval( $plugin_installed ) < DAY_IN_SECONDS ) ) { return; } if ( ( $expiration = get_option( self::$dismiss_key . '_exp', '' ) ) === '' ) { //phpcs:ignore Squiz.PHP.DisallowMultipleAssignments.FoundInControlStructure update_option( self::$dismiss_key . '_exp', time() ); } // Let's dismiss the notice if the user sees it for more than 1 week. if ( ! empty( $expiration ) && ( time() - intval( $expiration ) ) > self::EXPIRATION ) { update_option( self::$dismiss_key, 'yes' ); return; } ?>
Check the newest theme recommended by Orbit Fox
Fully AMP optimized and responsive, Neve will load in mere seconds and adapt perfectly on any viewing device. Neve works perfectly with Gutenberg and the most popular page builders. You will love it!
Dismiss this notice.