plugin = $plugin; $this->sholud_show_server_info = 'wt_' . $this->plugin . '_show_server_info'; if ( !$this->wt_get_display_server_info() ) { if ( Wt_Import_Export_For_Woo_Basic_Common_Helper::wt_is_screen_allowed() ) { $this->banner_css_class = 'wt_' . $this->plugin . '_show_server_info'; add_action( 'admin_notices', array( $this, 'show_banner' ) ); add_action( 'admin_print_footer_scripts', array( $this, 'add_banner_scripts' ) ); /* add banner scripts */ } } $this->ajax_action_name = $this->plugin . '_process_show_server_info_action'; add_action( 'wp_ajax_' . $this->ajax_action_name, array( $this, 'process_server_info__action' ) ); /* process banner user action */ } /** * Prints the banner */ public function show_banner() { ?>
plugin ); if ( isset( $_POST[ 'wt_action_type' ] ) && 'dismiss' == $_POST[ 'wt_action_type' ] ) { $this->wt_set_display_server_info( 1 ); } exit(); } /** * Add banner JS to admin footer */ public function add_banner_scripts() { $ajax_url = admin_url( 'admin-ajax.php' ); $nonce = wp_create_nonce( $this->plugin ); ?> sholud_show_server_info ); } } public function wt_set_display_server_info( $display = false ) { update_option( $this->sholud_show_server_info, $display ? 1 : 0 ); } } }