本文整理汇总了PHP中WC_Admin_Notices::remove_notice方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Admin_Notices::remove_notice方法的具体用法?PHP WC_Admin_Notices::remove_notice怎么用?PHP WC_Admin_Notices::remove_notice使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WC_Admin_Notices
的用法示例。
在下文中一共展示了WC_Admin_Notices::remove_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;
}
}
}
示例2: install_actions
/**
* Install actions when a update button is clicked.
*/
public static function install_actions()
{
if (!empty($_GET['do_update_woocommerce'])) {
self::update();
WC_Admin_Notices::remove_notice('update');
add_action('admin_notices', array(__CLASS__, 'updated_notice'));
}
}
示例3: install_actions
/**
* Install actions such as installing pages when a button is clicked.
*/
public static function install_actions()
{
if (!empty($_GET['do_update_woocommerce'])) {
self::update();
// Update complete
WC_Admin_Notices::remove_notice('update');
// What's new redirect
delete_transient('_wc_activation_redirect');
wp_redirect(admin_url('index.php?page=wc-about&wc-updated=true'));
exit;
}
}
示例4: update
/**
* Runs all pending WooCommerce database updates.
*/
public static function update()
{
global $wpdb;
$wpdb->hide_errors();
include_once WC_ABSPATH . 'includes/class-wc-install.php';
include_once WC_ABSPATH . 'includes/wc-update-functions.php';
$current_db_version = get_option('woocommerce_db_version');
$update_count = 0;
foreach (WC_Install::get_db_update_callbacks() as $version => $update_callbacks) {
if (version_compare($current_db_version, $version, '<')) {
foreach ($update_callbacks as $update_callback) {
WP_CLI::log(sprintf(__('Calling update function: %s', 'woocommerce'), $update_callback));
call_user_func($update_callback);
$update_count++;
}
}
}
WC_Admin_Notices::remove_notice('update');
WP_CLI::success(sprintf(__('%1$d updates complete. Database version is %2$s', 'woocommerce'), absint($update_count), get_option('woocommerce_db_version')));
}
示例5: wc_setup_ready_actions
/**
* Actions on the final step
*/
private function wc_setup_ready_actions()
{
WC_Admin_Notices::remove_notice('install');
if (isset($_GET['wc_tracker_optin']) && isset($_GET['wc_tracker_nonce']) && wp_verify_nonce($_GET['wc_tracker_nonce'], 'wc_tracker_optin')) {
update_option('woocommerce_allow_tracking', 'yes');
WC_Tracker::send_tracking_data(true);
} elseif (isset($_GET['wc_tracker_optout']) && isset($_GET['wc_tracker_nonce']) && wp_verify_nonce($_GET['wc_tracker_nonce'], 'wc_tracker_optout')) {
update_option('woocommerce_allow_tracking', 'no');
}
}