當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WC_Admin_Notices::has_notice方法代碼示例

本文整理匯總了PHP中WC_Admin_Notices::has_notice方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Admin_Notices::has_notice方法的具體用法?PHP WC_Admin_Notices::has_notice怎麽用?PHP WC_Admin_Notices::has_notice使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WC_Admin_Notices的用法示例。


在下文中一共展示了WC_Admin_Notices::has_notice方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: install_actions

 /**
  * Install actions such as installing pages when a button is clicked.
  */
 public static function install_actions()
 {
     // Install - Add pages button
     if (!empty($_GET['install_woocommerce_pages'])) {
         self::create_pages();
         // We no longer need to install pages
         WC_Admin_Notices::remove_notice('install');
         // What's new redirect
         if (!WC_Admin_Notices::has_notice('update')) {
             delete_transient('_wc_activation_redirect');
             wp_redirect(admin_url('index.php?page=wc-about&wc-updated=true'));
             exit;
         }
         // Update button
     } elseif (!empty($_GET['do_update_woocommerce'])) {
         self::update();
         // Update complete
         WC_Admin_Notices::remove_notice('update');
         // What's new redirect
         if (!WC_Admin_Notices::has_notice('install')) {
             delete_transient('_wc_activation_redirect');
             wp_redirect(admin_url('index.php?page=wc-about&wc-updated=true'));
             exit;
         }
     }
 }
開發者ID:pantelicnevena,項目名稱:newhanan,代碼行數:29,代碼來源:class-wc-install.php

示例2: admin_redirects

 /**
  * Handle redirects to setup/welcome page after install and updates.
  *
  * For setup wizard, transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.
  */
 public function admin_redirects()
 {
     // Nonced plugin install redirects (whitelisted)
     if (!empty($_GET['wc-install-plugin-redirect'])) {
         $plugin_slug = wc_clean($_GET['wc-install-plugin-redirect']);
         if (current_user_can('install_plugins') && in_array($plugin_slug, array('woocommerce-gateway-stripe'))) {
             $nonce = wp_create_nonce('install-plugin_' . $plugin_slug);
             $url = self_admin_url('update.php?action=install-plugin&plugin=' . $plugin_slug . '&_wpnonce=' . $nonce);
         } else {
             $url = admin_url('plugin-install.php?tab=search&type=term&s=' . $plugin_slug);
         }
         wp_safe_redirect($url);
         exit;
     }
     // Setup wizard redirect
     if (get_transient('_wc_activation_redirect')) {
         delete_transient('_wc_activation_redirect');
         if (!empty($_GET['page']) && in_array($_GET['page'], array('wc-setup')) || is_network_admin() || isset($_GET['activate-multi']) || !current_user_can('manage_woocommerce') || apply_filters('woocommerce_prevent_automatic_wizard_redirect', false)) {
             return;
         }
         // If the user needs to install, send them to the setup wizard
         if (WC_Admin_Notices::has_notice('install')) {
             wp_safe_redirect(admin_url('index.php?page=wc-setup'));
             exit;
         }
     }
 }
開發者ID:jesusmarket,項目名稱:jesusmarket,代碼行數:32,代碼來源:class-wc-admin.php

示例3: admin_redirects

 /**
  * Handle redirects to setup/welcome page after install and updates.
  *
  * Transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.
  */
 public function admin_redirects()
 {
     if (!get_transient('_wc_activation_redirect')) {
         return;
     }
     delete_transient('_wc_activation_redirect');
     if (!empty($_GET['page']) && in_array($_GET['page'], array('wc-setup')) || is_network_admin() || isset($_GET['activate-multi']) || !current_user_can('manage_woocommerce') || apply_filters('woocommerce_prevent_automatic_wizard_redirect', false)) {
         return;
     }
     // If the user needs to install, send them to the setup wizard
     if (WC_Admin_Notices::has_notice('install')) {
         wp_safe_redirect(admin_url('index.php?page=wc-setup'));
         exit;
     }
 }
開發者ID:capuderg,項目名稱:woocommerce,代碼行數:20,代碼來源:class-wc-admin.php

示例4: admin_redirects

 /**
  * Handle redirects to setup/welcome page after install and updates.
  *
  * Transient must be present, the user must have access rights, and we must ignore the network/bulk plugin updaters.
  */
 public function admin_redirects()
 {
     if (!get_transient('_wc_activation_redirect') || is_network_admin() || isset($_GET['activate-multi']) || !current_user_can('manage_woocommerce')) {
         return;
     }
     delete_transient('_wc_activation_redirect');
     if (!empty($_GET['page']) && in_array($_GET['page'], array('wc-setup', 'wc-about'))) {
         return;
     }
     // If the user needs to install, send them to the setup wizard
     if (WC_Admin_Notices::has_notice('install')) {
         wp_safe_redirect(admin_url('index.php?page=wc-setup'));
         exit;
         // Otherwise, the welcome page
     } else {
         wp_safe_redirect(admin_url('index.php?page=wc-about'));
         exit;
     }
 }
開發者ID:Junaid-Farid,項目名稱:gocnex,代碼行數:24,代碼來源:class-wc-admin.php

示例5: welcome

 /**
  * Sends user to the welcome page on first activation.
  */
 public function welcome()
 {
     // Bail if no activation redirect transient is set
     if (!get_transient('_wc_activation_redirect')) {
         return;
     }
     // Delete the redirect transient
     delete_transient('_wc_activation_redirect');
     // Bail if we are waiting to install or update via the interface update/install links
     if (WC_Admin_Notices::has_notice('install') || WC_Admin_Notices::has_notice('update')) {
         return;
     }
     // Bail if activating from network, or bulk, or within an iFrame
     if (is_network_admin() || isset($_GET['activate-multi']) || defined('IFRAME_REQUEST')) {
         return;
     }
     if (isset($_GET['action']) && 'upgrade-plugin' == $_GET['action'] || !empty($_GET['page']) && $_GET['page'] === 'wc-about') {
         return;
     }
     wp_redirect(admin_url('index.php?page=wc-about'));
     exit;
 }
開發者ID:abesamislyndon,項目名稱:femaccms,代碼行數:25,代碼來源:class-wc-admin-welcome.php


注:本文中的WC_Admin_Notices::has_notice方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。