• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP woocommerce_update_options函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中woocommerce_update_options函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_update_options函数的具体用法?PHP woocommerce_update_options怎么用?PHP woocommerce_update_options使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了woocommerce_update_options函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: save

 /**
  * Save the settings
  */
 function save()
 {
     global $current_section;
     set_transient('wcdn_flush_rewrite_rules', true);
     $settings = $this->get_settings($current_section);
     woocommerce_update_options($settings);
 }
开发者ID:sammykumar,项目名称:goodbeads,代码行数:10,代码来源:class-wcdn-settings.php


示例2: update_woo_settings

 function update_woo_settings()
 {
     global $woocommerce_settings, $rtWooGLAdmin;
     woocommerce_update_options($woocommerce_settings['rtwoogl']);
     $endPoint = trailingslashit(get_option('rtwoogl_api_endpoint', ''));
     $token = get_option('rtwoogl_private_token', '');
     $response = $rtWooGLAdmin->test_connection($endPoint, $token);
     if ($response['result'] == 'error') {
         update_site_option('rtwoogl_settings_error', '<div id="rtwoogl_message" class="error fade"><p><strong>' . $response['message'] . '</strong></p></div>');
     }
 }
开发者ID:rtCamp,项目名称:integrate-woocommerce-gitlab,代码行数:11,代码来源:RtWooGlSettings.php


示例3: woocommerce_update_options

 /**
  * Update options
  *
  * @return void
  * @since    1.0
  * @author   Andrea Grillo      <[email protected]>
  * @author   Antonio La Rocca   <[email protected]>
  * @see      woocommerce_update_options function
  * @internal fire two action (before and after update): yit_panel_wc_before_update and yit_panel_wc_after_update
  */
 public function woocommerce_update_options()
 {
     if (isset($_POST['yit_panel_wc_options_nonce']) && wp_verify_nonce($_POST['yit_panel_wc_options_nonce'], 'yit_panel_wc_options_' . $this->settings['page'])) {
         do_action('yit_panel_wc_before_update');
         $yit_options = $this->get_main_array_options();
         $current_tab = $this->get_current_tab();
         woocommerce_update_options($yit_options[$current_tab]);
         do_action('yit_panel_wc_after_update');
     } elseif (isset($_REQUEST['yit-action']) && $_REQUEST['yit-action'] == 'wc-options-reset') {
         $yit_options = $this->get_main_array_options();
         $current_tab = $this->get_current_tab();
         foreach ($yit_options[$current_tab] as $id => $option) {
             if (isset($option['default'])) {
                 update_option($option['id'], $option['default']);
             }
         }
     }
 }
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:28,代码来源:yit-plugin-panel-wc.php


示例4: update_options

 public static function update_options($options)
 {
     $rule_id = self::$RULE_ID;
     if (!empty($rule_id)) {
         $settings = self::get_rule_settings_by_id($rule_id);
         woocommerce_update_options($settings);
     }
 }
开发者ID:rulecom,项目名称:woorule,代码行数:8,代码来源:class-wc-admin-settings-woorule.php


示例5: woocommerce_update_options

 /**
  * Update options
  *
  * @return void
  * @since    1.0
  * @author   Andrea Grillo      <[email protected]>
  * @author   Antonio La Rocca   <[email protected]>
  * @see      woocommerce_update_options function
  * @internal fire two action (before and after update): yit_panel_wc_before_update and yit_panel_wc_after_update
  */
 public function woocommerce_update_options()
 {
     if (isset($_POST['yit_panel_wc_options_nonce']) && wp_verify_nonce($_POST['yit_panel_wc_options_nonce'], 'yit_panel_wc_options_' . $this->settings['page'])) {
         do_action('yit_panel_wc_before_update');
         $yit_options = $this->get_main_array_options();
         $current_tab = $this->get_current_tab();
         if (version_compare(WC()->version, '2.4.0', '>=')) {
             if (!empty($yit_options[$current_tab])) {
                 foreach ($yit_options[$current_tab] as $option) {
                     if (isset($option['id']) && isset($_POST[$option['id']]) && isset($option['type']) && !in_array($option['type'], $this->wc_type)) {
                         $_POST[$option['id']] = maybe_serialize($_POST[$option['id']]);
                     }
                 }
             }
         }
         woocommerce_update_options($yit_options[$current_tab]);
         do_action('yit_panel_wc_after_update');
     } elseif (isset($_REQUEST['yit-action']) && $_REQUEST['yit-action'] == 'wc-options-reset' && isset($_POST['yith_wc_reset_options_nonce']) && wp_verify_nonce($_POST['yith_wc_reset_options_nonce'], 'yith_wc_reset_options_' . $this->settings['page'])) {
         $yit_options = $this->get_main_array_options();
         $current_tab = $this->get_current_tab();
         foreach ($yit_options[$current_tab] as $id => $option) {
             if (isset($option['default'])) {
                 update_option($option['id'], $option['default']);
             }
         }
     }
 }
开发者ID:JaneJieYing,项目名称:HiFridays,代码行数:37,代码来源:yit-plugin-panel-wc.php


示例6: prdctfltr_update_settings

 public static function prdctfltr_update_settings()
 {
     if (isset($_POST['pfa_taxonomy'])) {
         $adv_filters = array();
         for ($i = 0; $i < count($_POST['pfa_taxonomy']); $i++) {
             $adv_filters['pfa_title'][$i] = $_POST['pfa_title'][$i];
             $adv_filters['pfa_taxonomy'][$i] = $_POST['pfa_taxonomy'][$i];
             $adv_filters['pfa_include'][$i] = isset($_POST['pfa_include'][$i]) ? $_POST['pfa_include'][$i] : array();
             $adv_filters['pfa_orderby'][$i] = isset($_POST['pfa_orderby'][$i]) ? $_POST['pfa_orderby'][$i] : '';
             $adv_filters['pfa_order'][$i] = isset($_POST['pfa_order'][$i]) ? $_POST['pfa_order'][$i] : '';
             $adv_filters['pfa_multiselect'][$i] = isset($_POST['pfa_multiselect'][$i]) ? $_POST['pfa_multiselect'][$i] : 'no';
             $adv_filters['pfa_relation'][$i] = isset($_POST['pfa_relation'][$i]) ? $_POST['pfa_relation'][$i] : 'IN';
             $adv_filters['pfa_adoptive'][$i] = isset($_POST['pfa_adoptive'][$i]) ? $_POST['pfa_adoptive'][$i] : 'no';
             $adv_filters['pfa_none'][$i] = isset($_POST['pfa_none'][$i]) ? $_POST['pfa_none'][$i] : 'no';
             $adv_filters['pfa_limit'][$i] = isset($_POST['pfa_limit'][$i]) ? $_POST['pfa_limit'][$i] : '';
             $adv_filters['pfa_hierarchy'][$i] = isset($_POST['pfa_hierarchy'][$i]) ? $_POST['pfa_hierarchy'][$i] : 'no';
             $adv_filters['pfa_hierarchy_mode'][$i] = isset($_POST['pfa_hierarchy_mode'][$i]) ? $_POST['pfa_hierarchy_mode'][$i] : 'no';
             $adv_filters['pfa_mode'][$i] = isset($_POST['pfa_mode'][$i]) ? $_POST['pfa_mode'][$i] : 'showall';
             $adv_filters['pfa_style'][$i] = isset($_POST['pfa_style'][$i]) ? $_POST['pfa_style'][$i] : 'pf_attr_text';
             $adv_filters['pfa_term_customization'][$i] = isset($_POST['pfa_term_customization'][$i]) ? $_POST['pfa_term_customization'][$i] : '';
         }
         update_option('wc_settings_prdctfltr_advanced_filters', $adv_filters);
     }
     if (isset($_POST['pfr_taxonomy'])) {
         $rng_filters = array();
         for ($i = 0; $i < count($_POST['pfr_taxonomy']); $i++) {
             $rng_filters['pfr_title'][$i] = $_POST['pfr_title'][$i];
             $rng_filters['pfr_taxonomy'][$i] = $_POST['pfr_taxonomy'][$i];
             $rng_filters['pfr_include'][$i] = isset($_POST['pfr_include'][$i]) ? $_POST['pfr_include'][$i] : array();
             $rng_filters['pfr_orderby'][$i] = isset($_POST['pfr_orderby'][$i]) ? $_POST['pfr_orderby'][$i] : '';
             $rng_filters['pfr_order'][$i] = isset($_POST['pfr_order'][$i]) ? $_POST['pfr_order'][$i] : '';
             $rng_filters['pfr_style'][$i] = isset($_POST['pfr_style'][$i]) ? $_POST['pfr_style'][$i] : 'flat';
             $rng_filters['pfr_grid'][$i] = isset($_POST['pfr_grid'][$i]) ? $_POST['pfr_grid'][$i] : 'no';
             $rng_filters['pfr_custom'][$i] = isset($_POST['pfr_custom'][$i]) ? $_POST['pfr_custom'][$i] : 'no';
         }
         update_option('wc_settings_prdctfltr_range_filters', $rng_filters);
     }
     if (isset($_POST['wc_settings_prdctfltr_active_filters'])) {
         update_option('wc_settings_prdctfltr_active_filters', $_POST['wc_settings_prdctfltr_active_filters']);
     }
     woocommerce_update_options(self::prdctfltr_get_settings('update'));
     delete_transient('prdctfltr_default');
 }
开发者ID:hikaram,项目名称:wee,代码行数:43,代码来源:pf-settings.php


示例7: save

 /**
  * Save settings
  */
 public function save()
 {
     global $woocommerce, $woocommerce_settings, $current_section;
     $settings = $this->get_settings();
     include_once MailPoet_WooCommerce_Add_on()->wc_plugin_path() . 'admin/settings/settings-save.php';
     $current_section = empty($_REQUEST['section']) ? 'general' : sanitize_text_field(urldecode($_REQUEST['section']));
     woocommerce_update_options($settings);
     if ($current_section == 'lists') {
         // Each list of newsletters that have been ticked will be saved.
         if (isset($_POST['checkout_lists'])) {
             $checkout_lists = $_POST['checkout_lists'];
             update_option('mailpoet_woocommerce_subscribe_too', $checkout_lists);
         } else {
             delete_option('mailpoet_woocommerce_subscribe_too');
         }
     }
 }
开发者ID:rinodung,项目名称:live-theme,代码行数:20,代码来源:class-mailpoet-woocommerce-admin-settings.php


示例8: dhwc_product_brand_save_admin_settings

/**
 * dhwc_product_brand_save_admin_settings function
 */
function dhwc_product_brand_save_admin_settings()
{
    woocommerce_update_options(dhwc_product_brand_get_admin_settings());
}
开发者ID:jmead,项目名称:trucell-cms,代码行数:7,代码来源:dhwc-brand-admin.php


示例9: save_settings

 /**
  * Save settings in a single field in the database for each tab's fields (one field per tab).
  */
 public function save_settings()
 {
     global $woocommerce_settings;
     // Make sure our settings fields are recognised.
     $this->add_settings_fields();
     $current_tab = $this->get_tab_in_view(current_filter(), 'woocommerce_update_options_');
     woocommerce_update_options($woocommerce_settings[$current_tab]);
 }
开发者ID:RainyDayMedia,项目名称:carbide-probes,代码行数:11,代码来源:woocommerce-bulk-discount.php


示例10: update_subscription_settings

 /**
  * Uses the WooCommerce options API to save settings via the @see woocommerce_update_options() function.
  *
  * @uses woocommerce_update_options()
  * @uses self::get_settings()
  * @since 1.0
  */
 public static function update_subscription_settings()
 {
     // Make sure automatic payments are on when manual renewals are switched off
     if (!isset($_POST[self::$option_prefix . '_accept_manual_renewals']) && isset($_POST[self::$option_prefix . '_turn_off_automatic_payments'])) {
         unset($_POST[self::$option_prefix . '_turn_off_automatic_payments']);
     }
     woocommerce_update_options(self::get_settings());
 }
开发者ID:bulats,项目名称:chef,代码行数:15,代码来源:class-wc-subscriptions-admin.php


示例11: update_settings

 public static function update_settings()
 {
     global $current_section;
     woocommerce_update_options(self::get_settings($current_section));
 }
开发者ID:viktorjezekcz,项目名称:ceske-sluzby,代码行数:5,代码来源:class-ceske-sluzby-admin.php


示例12: wcla_update_options

 public function wcla_update_options()
 {
     woocommerce_update_options(WCLA_Utilities::get_fields());
 }
开发者ID:soshace,项目名称:designer-plugin-wp4,代码行数:4,代码来源:DesignerWCAdmin.class.php


示例13: save_settings

 /**
  * Save the 'Pre-Orders' settings page
  *
  * @since 1.0
  */
 public function save_settings()
 {
     woocommerce_update_options($this->get_settings());
 }
开发者ID:shahadat014,项目名称:geleyi,代码行数:9,代码来源:class-wc-pre-orders-admin.php


示例14: update_admin_settings

 public static function update_admin_settings()
 {
     woocommerce_update_options(self::get_admin_form());
 }
开发者ID:arifur,项目名称:woocommerce-pay-what-you-want,代码行数:4,代码来源:woocommerce-pay-what-you-want.php


示例15: save_settings

 /**
  * save_settings()
  *
  * Save settings in a single field in the database for each tab's fields (one field per tab).
  */
 function save_settings()
 {
     global $woocommerce_settings;
     // Make sure our settings fields are recognised.
     $this->add_settings_fields();
     $current_tab = $this->get_tab_in_view(current_filter(), 'woocommerce_update_options_');
     woocommerce_update_options($woocommerce_settings[$current_tab]);
     // This is to prevent html being stripped until the WC settings api supports custom field saving
     if (isset($_POST['wc_cvo_s_price_text'])) {
         $data = wp_unslash(wp_kses_post($_POST['wc_cvo_s_price_text']));
         update_option('wc_cvo_s_price_text', $data);
     }
 }
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:18,代码来源:woocommerce-catalog-visibility-options.php


示例16: render_submenu_pages

    /**
     * Render the sub-menu page for 'CSV Export'
     *
     * @since 3.0
     */
    public function render_submenu_pages()
    {
        // permissions check
        if (!current_user_can('manage_woocommerce')) {
            return;
        }
        $this->tabs = array('export' => __('Export', WC_Customer_Order_CSV_Export::TEXT_DOMAIN), 'settings' => __('Settings', WC_Customer_Order_CSV_Export::TEXT_DOMAIN));
        $current_tab = empty($_GET['tab']) ? 'export' : urldecode($_GET['tab']);
        // settings
        if (!empty($_POST) && 'settings' == $current_tab) {
            // security check
            if (!wp_verify_nonce($_POST['_wpnonce'], __FILE__)) {
                wp_die(__('Action failed. Please refresh the page and retry.', WC_Customer_Order_CSV_Export::TEXT_DOMAIN));
            }
            if (isset($_POST['wc_customer_order_csv_export_test_method'])) {
                // process test
                $export = new WC_Customer_Order_CSV_Export_Handler(0);
                $result = $export->test_export_via($_POST['wc_customer_order_csv_export_test_method']);
                $this->message_handler->add_message($result);
            } else {
                $orig_start_inverval = get_option('wc_customer_order_csv_export_auto_export_start_time') . get_option('wc_customer_order_csv_export_auto_export_interval');
                // save settings
                woocommerce_update_options($this->get_settings('settings'));
                // clear scheduled export event if export interval and/or start time were changed
                if ($orig_start_inverval !== get_option('wc_customer_order_csv_export_auto_export_start_time') . get_option('wc_customer_order_csv_export_auto_export_interval')) {
                    // note this resets the next scheduled execution time to the time options were saved + the interval
                    wp_clear_scheduled_hook('wc_customer_order_csv_export_auto_export_orders');
                }
                $this->message_handler->add_message(__('Your settings have been saved.', WC_Customer_Order_CSV_Export::TEXT_DOMAIN));
            }
        }
        ?>
		<div class="wrap woocommerce">
		<form method="post" id="mainform" action="" enctype="multipart/form-data">
			<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
				<?php 
        foreach ($this->tabs as $tab_id => $tab_title) {
            $class = $tab_id == $current_tab ? array('nav-tab', 'nav-tab-active') : array('nav-tab');
            $url = add_query_arg('tab', $tab_id, admin_url('admin.php?page=wc_customer_order_csv_export'));
            printf('<a href="%s" class="%s">%s</a>', esc_url($url), implode(' ', array_map('sanitize_html_class', $class)), esc_html($tab_title));
        }
        ?>
 </h2> <?php 
        $this->message_handler->show_messages();
        if ('settings' == $current_tab) {
            $this->render_settings_page();
        } else {
            $this->render_export_page();
        }
        ?>
 </form>
		</div> <?php 
    }
开发者ID:daanbakker1995,项目名称:vanteun,代码行数:58,代码来源:class-wc-customer-order-csv-export-admin.php


示例17: update_settings

 function update_settings()
 {
     woocommerce_update_options(self::get_settings());
 }
开发者ID:webmaniabr,项目名称:NFeWooCommerce,代码行数:4,代码来源:custom_backend.php


示例18: woocommerce_hide_product_update_options

 public static function woocommerce_hide_product_update_options()
 {
     woocommerce_update_options(WooCommerce_Hide_Products_Admin::woocommerce_hide_product_admin_options());
 }
开发者ID:Qualitair,项目名称:ecommerce,代码行数:4,代码来源:class-admin-settings.php


示例19: update_options

 /**
  * Update plugin options.
  * 
  * @return void
  * @since 1.0.0
  */
 public function update_options()
 {
     foreach ($this->options as $option) {
         woocommerce_update_options($option);
     }
     foreach ($this->colors_options as $name => $option) {
         foreach ($option as $id => $color) {
             $this->colors_options[$name][$id] = isset($_POST['yith_wcwl_color_' . $name . '_' . $id]) && !empty($_POST['yith_wcwl_color_' . $name . '_' . $id]) ? woocommerce_format_hex($_POST['yith_wcwl_color_' . $name . '_' . $id]) : '';
         }
     }
     update_option('yith_wcwl_frontend_css_colors', maybe_serialize($this->colors_options));
 }
开发者ID:shahadat014,项目名称:geleyi,代码行数:18,代码来源:class.yith-wcwl-init.php


示例20: woo_vou_update_settings

 /**
  * Update Settings
  * 
  * Updates the voucher options when being saved.
  *
  *  @package WooCommerce - PDF Vouchers
  * @since 1.6
  */
 public function woo_vou_update_settings()
 {
     woocommerce_update_options($this->woo_vou_get_settings());
 }
开发者ID:flasomm,项目名称:Montkailash,代码行数:12,代码来源:class-woo-vou-admin-settings-tabs.php



注:本文中的woocommerce_update_options函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woocommerce_update_order_item_meta函数代码示例发布时间:2022-05-23
下一篇:
PHP woocommerce_template_single_price函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap