当前位置: 首页>>代码示例>>PHP>>正文


PHP WC_Admin_Settings::save_fields方法代码示例

本文整理汇总了PHP中WC_Admin_Settings::save_fields方法的典型用法代码示例。如果您正苦于以下问题:PHP WC_Admin_Settings::save_fields方法的具体用法?PHP WC_Admin_Settings::save_fields怎么用?PHP WC_Admin_Settings::save_fields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WC_Admin_Settings的用法示例。


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

示例1: update_options

 /**
  * Save settings.
  *
  * Save settings based on WooCommerce save_fields() method.
  *
  * @since 1.0.0
  */
 public function update_options()
 {
     global $current_section;
     if ($current_section == 'shipping_validation') {
         WC_Admin_Settings::save_fields($this->get_settings());
     }
 }
开发者ID:JeroenSormani,项目名称:advanced-shipping-validation-for-woocommerce,代码行数:14,代码来源:class-wcasv-admin-settings.php

示例2: save

        /**
         * Save settings.
         *
         * @since 1.0.0
         */
        public function save() {

            global $current_section;

            $settings = $this->get_settings( $current_section );
            WC_Admin_Settings::save_fields( $settings );

        }
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:13,代码来源:class-wwp-settings.php

示例3: save

 /**
  * Save settings
  */
 public function save()
 {
     global $current_section;
     $settings = $this->get_settings();
     WC_Admin_Settings::save_fields($settings);
     if ($current_section) {
         do_action('woocommerce_update_options_' . $this->id . '_' . $current_section);
     }
 }
开发者ID:joshquila,项目名称:demo2-youse,代码行数:12,代码来源:class-wc-settings-page.php

示例4: save_settings

 public function save_settings()
 {
     WC_Admin_Settings::save_fields($this->settings);
     $is_api_working = $this->check_api() ? 1 : 0;
     update_option(WC_SiftScience_Options::$is_api_setup, $is_api_working);
     if ($is_api_working === 1) {
         WC_Admin_Settings::add_message('API is correctly configured');
     } else {
         WC_Admin_Settings::add_error('API settings are broken');
     }
 }
开发者ID:Fermiac,项目名称:woocommerce-siftscience,代码行数:11,代码来源:class-wc-siftscience-hooks-admin.php

示例5: save

 /**
  * Save settings
  */
 public function save()
 {
     global $current_section, $wpdb;
     if (!$current_section) {
         $settings = $this->get_settings();
         WC_Admin_Settings::save_fields($settings);
     } elseif (!empty($_POST['tax_rate_country'])) {
         $this->save_tax_rates();
     }
     $wpdb->query("DELETE FROM `{$wpdb->options}` WHERE `option_name` LIKE ('_transient_wc_tax_rates_%') OR `option_name` LIKE ('_transient_timeout_wc_tax_rates_%')");
 }
开发者ID:ayoayco,项目名称:upbeat,代码行数:14,代码来源:class-wc-settings-tax.php

示例6: save

 /**
  * Save settings.
  */
 public function save()
 {
     global $current_section, $wpdb;
     if (!$current_section) {
         $settings = $this->get_settings();
         WC_Admin_Settings::save_fields($settings);
     } elseif (!empty($_POST['tax_rate_country'])) {
         $this->save_tax_rates();
     }
     WC_Cache_Helper::incr_cache_prefix('taxes');
 }
开发者ID:estrategasdigitales,项目名称:venone,代码行数:14,代码来源:class-wc-settings-tax.php

示例7: save

 /**
  * Save settings
  */
 public function save()
 {
     global $current_section;
     if ($current_section == '') {
         $settings = $this->rf_genaral_setting();
     } elseif ($current_section == 'email_template') {
         $settings = $this->rf_email_template_setting();
     } else {
         $settings = $this->rf_social_share_setting();
     }
     WC_Admin_Settings::save_fields($settings);
 }
开发者ID:javolero,项目名称:dabba,代码行数:15,代码来源:referfriend-settings.php

示例8: save

 /**
  * Save settings
  */
 public function save()
 {
     global $current_section;
     $settings = $this->get_settings();
     WC_Admin_Settings::save_fields($settings);
     if ($current_section == 'lists') {
         // Each list that has 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:alikagitci,项目名称:honda.yedekleri,代码行数:18,代码来源:class-mailpoet-woocommerce-settings.php

示例9: save

 /**
  * Save settings.
  */
 public function save()
 {
     global $current_section;
     if (!$current_section) {
         WC_Admin_Settings::save_fields($this->get_settings());
     } else {
         $wc_emails = WC_Emails::instance();
         if (in_array($current_section, array_map('sanitize_title', array_keys($wc_emails->get_emails())))) {
             foreach ($wc_emails->get_emails() as $email_id => $email) {
                 if ($current_section === sanitize_title($email_id)) {
                     do_action('woocommerce_update_options_' . $this->id . '_' . $email->id);
                 }
             }
         } else {
             do_action('woocommerce_update_options_' . $this->id . '_' . $current_section);
         }
     }
 }
开发者ID:tlovett1,项目名称:woocommerce,代码行数:21,代码来源:class-wc-settings-emails.php

示例10: save

 /**
  * Save settings.
  */
 public function save()
 {
     $settings = $this->get_settings();
     WC_Admin_Settings::save_fields($settings);
 }
开发者ID:unfulvio,项目名称:woocommerce,代码行数:8,代码来源:class-wc-settings-general.php

示例11: save

 /**
  * Save settings
  */
 public function save()
 {
     $settings = $this->get_settings();
     WC_Admin_Settings::save_fields($settings);
     if (isset($_POST['qsot_frontend_css_form_bg'])) {
         // Save settings
         $colors = array();
         foreach (array('form_bg', 'form_border', 'form_action_bg', 'form_helper') as $k) {
             $colors[$k] = !empty($_POST['qsot_frontend_css_' . $k]) ? wc_format_hex($_POST['qsot_frontend_css_' . $k]) : '';
         }
         foreach (array('good_msg', 'bad_msg', 'remove') as $K) {
             foreach (array('_bg', '_border', '_text') as $k) {
                 $colors[$K . $k] = !empty($_POST['qsot_frontend_css_' . $K . $k]) ? wc_format_hex($_POST['qsot_frontend_css_' . $K . $k]) : '';
             }
         }
         foreach (array('past_calendar_item', 'calendar_item') as $K) {
             foreach (array('_bg', '_border', '_text', '_text_hover') as $k) {
                 $colors[$K . $k] = !empty($_POST['qsot_frontend_css_' . $K . $k]) ? wc_format_hex($_POST['qsot_frontend_css_' . $K . $k]) : '';
             }
         }
         // Check the colors.
         $valid_colors = true;
         foreach ($colors as $color) {
             if (!preg_match('/^#[a-f0-9]{6}$/i', $color)) {
                 $valid_colors = false;
                 WC_Admin_Settings::add_error(sprintf(__('Error saving the Frontend Styles, %s is not a valid color, please use only valid colors code.', 'opentickets-community-edition'), $color));
                 break;
             }
         }
         if ($valid_colors) {
             $old_colors = get_option('woocommerce_frontend_css_colors');
             $options = qsot_options::instance();
             $options->{'qsot-event-frontend-colors'} = $colors;
             if ($old_colors != $colors) {
                 QSOT::compile_frontend_styles();
             }
         }
     }
 }
开发者ID:galapas,项目名称:opentickets-community,代码行数:42,代码来源:frontend.php

示例12: woocommerce_update_options

/**
 * Update all settings which are passed.
 *
 * @access public
 * @param array $options
 * @return void
 */
function woocommerce_update_options($options)
{
    if (!class_exists('WC_Admin_Settings')) {
        include 'class-wc-admin-settings.php';
    }
    WC_Admin_Settings::save_fields($options);
}
开发者ID:hoonio,项目名称:PhoneAfrika,代码行数:14,代码来源:wc-admin-functions.php

示例13: update_settings

/**
 * Update this plugin's WC Settings
 *
 * Hooks into WC's settings api
 * which allows for building, saving, and retrieval of options
 *
 * @since 3.0.0
 */
function update_settings()
{
    \WC_Admin_Settings::save_fields(get_settings());
}
开发者ID:evgalak,项目名称:woocommerce-product-faqs,代码行数:12,代码来源:admin.php

示例14: save

 /**
  * Save settings.
  */
 public function save()
 {
     global $current_section;
     switch ($current_section) {
         case 'options':
             WC_Admin_Settings::save_fields($this->get_settings());
             break;
         case 'classes':
         case '':
             break;
         default:
             $wc_shipping = WC_Shipping::instance();
             foreach ($wc_shipping->get_shipping_methods() as $method_id => $method) {
                 if (in_array($current_section, array($method->id, sanitize_title(get_class($method))))) {
                     do_action('woocommerce_update_options_' . $this->id . '_' . $method->id);
                 }
             }
             break;
     }
     // Increments the transient version to invalidate cache
     WC_Cache_Helper::get_transient_version('shipping', true);
 }
开发者ID:WPprodigy,项目名称:woocommerce,代码行数:25,代码来源:class-wc-settings-shipping.php

示例15: woocommerce_update_options

/**
 * Update all settings which are passed.
 *
 * @param array $options
 * @param array $data
 */
function woocommerce_update_options($options, $data = null)
{
    if (!class_exists('WC_Admin_Settings')) {
        include dirname(__FILE__) . '/class-wc-admin-settings.php';
    }
    WC_Admin_Settings::save_fields($options, $data);
}
开发者ID:Biont,项目名称:woocommerce,代码行数:13,代码来源:wc-admin-functions.php


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