offset = strtotime( '-7 days' ); add_action( 'admin_init', array( $this, 'checkInstallationDate' ) ); add_action( 'wp_ajax_' . self::DISMISS_AJAX_ACTION, array( $this, 'dismissNotice' ) ); add_action( 'admin_head', array( $this, 'loadStyle' ) ); add_action( 'admin_footer', array( $this, 'printDismissJS' ) ); } /** * Check if is possible to display admin notice on the current screen * * @return bool */ private function allowDisplay() { $currentScreen = get_current_screen(); if ( ! empty( $currentScreen ) && ( in_array( $currentScreen->base, array( 'dashboard', 'post', 'edit' ) ) || strpos( $currentScreen->base, DGWT_WCAS_SETTINGS_KEY ) !== false ) ) { return true; } return false; } /** * Display feedback notice * * @return void */ public function displayNotice() { global $current_user; if ( $this->allowDisplay() && ! dgoraAsfwFs()->is_premium() ) { ?>