芝麻web文件管理V1.00
编辑当前文件:/home4/randall/public_html/sl/wp-content/plugins/flexible-shipping/classes/notices/rate-notice.php
0 ) { update_option( \FSVendor\WPDesk\Notice\PermanentDismissibleNotice::OPTION_NAME_PREFIX . $notice_name, 1 ); } } /** * Should display notice. * * @return bool */ private function should_display_notice() { $current_screen = get_current_screen(); $display_on_screens = [ 'shop_order', 'edit-shop_order', 'woocommerce_page_wc-settings' ]; if ( ! empty( $current_screen ) && in_array( $current_screen->id, $display_on_screens, true ) ) { return true; } return false; } /** * Generate rate notice variant ID. * * @return string */ private function generate_rate_notice_variant_id() { return 'notice_2'; } /** * Set defaults for notice. */ private function set_notice_defaults() { add_option( self::SETTINGS_OPTION_RATE_NOTICE_DATE_DISMISS, date( "Y-m-d H:i:s", strtotime('NOW + 2 weeks') ) ); } /** * Add admin notice. */ public function add_admin_notice_action() { if ( $this->should_display_notice() ) { $instance = new RateNoticeImplementation(); $this->set_notice_defaults(); if( $instance->should_show_message() ) { $instance->show_message(); } } } }