output_fields() public static method

Loops though the woocommerce options array and outputs each field.
public static output_fields ( array $options )
$options array Opens array to output
示例#1
0
/**
 * Output admin fields.
 *
 * Loops though the woocommerce options array and outputs each field.
 *
 * @param array $options Opens array to output
 */
function woocommerce_admin_fields($options)
{
    if (!class_exists('WC_Admin_Settings')) {
        include 'class-wc-admin-settings.php';
    }
    WC_Admin_Settings::output_fields($options);
}
 /**
  * Output the settings.
  */
 public function output()
 {
     global $current_section, $hide_save_button;
     // Load shipping methods so we can show any global options they may have
     $shipping_methods = WC()->shipping->load_shipping_methods();
     if ('options' === $current_section) {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
         return;
     } elseif ('classes' === $current_section) {
         $hide_save_button = true;
         $this->output_shipping_class_screen();
         return;
     } else {
         foreach ($shipping_methods as $method) {
             if (strtolower(get_class($method)) === strtolower($current_section) && $method->has_settings()) {
                 $method->admin_options();
                 return;
             }
         }
     }
     // Default to zones screen
     $hide_save_button = true;
     $this->output_zones_screen();
 }
        /**
         * Output the settings.
         *
         * @since 1.0.0
         */
        public function output() {

            global $current_section;

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

        }
 public function output_settings_fields()
 {
     WC_Admin_Settings::output_fields($this->settings);
     $jsPath = $this->options->get_react_app_path();
     echo $this->batch_upload();
     $data = array('apiUrl' => plugins_url('api.php', dirname(__FILE__)));
     wp_enqueue_script('wc-siftsci-react-app', $jsPath, array(), false, true);
     wp_localize_script('wc-siftsci-react-app', "_siftsci_app_input_data", $data);
 }
 /**
  * Output the settings
  */
 public function output()
 {
     global $current_section;
     if ($current_section == '') {
         $GLOBALS['hide_save_button'] = true;
     }
     $settings = $this->get_settings($current_section);
     WC_Admin_Settings::output_fields($settings);
     $this->show_table_products();
 }
 public function output_settings()
 {
     global $current_section;
     $settings = $this->get_settings($current_section);
     $hide_sec = array('plugin', 'newsletter');
     if (in_array($current_section, $hide_sec)) {
         $GLOBALS['hide_save_button'] = true;
     } else {
         WC_Admin_Settings::output_fields($settings);
     }
 }
 /**
  * Render the settings for the current section
  *
  * @since 2.0.0
  */
 public function output()
 {
     $settings = $this->get_settings();
     // inject the actual setting value before outputting the fields
     // ::output_fields() uses get_option() but customizations are stored
     // in a single option so this dynamically returns the correct value
     foreach ($this->customizations as $filter => $value) {
         add_filter("pre_option_{$filter}", array($this, 'get_customization'));
     }
     WC_Admin_Settings::output_fields($settings);
 }
 /**
  * Output the settings
  */
 public function output()
 {
     global $current_section;
     $tax_classes = array_filter(array_map('trim', explode("\n", get_option('woocommerce_tax_classes'))));
     if ($current_section == 'standard' || in_array($current_section, array_map('sanitize_title', $tax_classes))) {
         $this->output_tax_rates();
     } else {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     }
 }
示例#9
0
 /**
  * Output the settings
  */
 public function output()
 {
     global $current_section;
     $tax_classes = WC_Tax::get_tax_classes();
     if ($current_section == 'standard' || in_array($current_section, array_map('sanitize_title', $tax_classes))) {
         $this->output_tax_rates();
     } else {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     }
 }
 /**
  * Output the settings
  */
 public function output()
 {
     global $current_section;
     $settings = $this->get_settings();
     WC_Admin_Settings::output_fields($settings);
     if ($current_section == 'lists') {
         include_once MailPoet_WooCommerce_Add_on()->plugin_path() . '/includes/admin/settings/settings-newsletters.php';
         $mailpoet_list = mailpoet_lists();
         do_action('woocommerce_mailpoet_list_newsletters', $mailpoet_list);
     }
 }
示例#11
0
 /**
  * Output the settings
  */
 public function output()
 {
     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::output_fields($settings);
 }
 /**
  * Output the settings.
  */
 public function output()
 {
     global $current_section;
     // Load shipping methods so we can show any global options they may have.
     $payment_gateways = WC()->payment_gateways->payment_gateways();
     if ($current_section) {
         foreach ($payment_gateways as $gateway) {
             if (in_array($current_section, array($gateway->id, sanitize_title(get_class($gateway))))) {
                 $gateway->admin_options();
                 break;
             }
         }
     } else {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     }
 }
 /**
  * Output the settings
  */
 public function output()
 {
     global $current_section;
     // Load shipping methods so we can show any global options they may have
     $shipping_methods = WC()->shipping->load_shipping_methods();
     if ($current_section) {
         foreach ($shipping_methods as $method) {
             if (strtolower(get_class($method)) == strtolower($current_section) && $method->has_settings()) {
                 $method->admin_options();
                 break;
             }
         }
     } else {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     }
 }
 /**
  * Output the settings.
  */
 public function output()
 {
     global $current_section;
     // Define emails that can be customised here
     $mailer = WC()->mailer();
     $email_templates = $mailer->get_emails();
     if ($current_section) {
         foreach ($email_templates as $email_key => $email) {
             if (strtolower($email_key) == $current_section) {
                 $email->admin_options();
                 break;
             }
         }
     } else {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     }
 }
 /**
  * Output the settings.
  */
 public function output()
 {
     global $current_section, $hide_save_button;
     // Load shipping methods so we can show any global options they may have
     $shipping_methods = WC()->shipping->load_shipping_methods();
     if ('' === $current_section) {
         $this->output_zones_screen();
     } elseif ('options' === $current_section) {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     } elseif ('classes' === $current_section) {
         $hide_save_button = true;
         $this->output_shipping_class_screen();
     } else {
         foreach ($shipping_methods as $method) {
             if (in_array($current_section, array($method->id, sanitize_title(get_class($method)))) && $method->has_settings()) {
                 $method->admin_options();
             }
         }
     }
 }
 /**
  * Output the settings.
  *
  * @version 2.5.3
  */
 function output()
 {
     global $current_section, $wcj_notice;
     if ('' != $wcj_notice) {
         echo '<div id="wcj_message" class="updated"><p><strong>' . $wcj_notice . '</strong></p></div>';
     }
     $is_dashboard = '' != $current_section && 'alphabetically' != $current_section && 'by_category' != $current_section && 'active' != $current_section && 'manager' != $current_section ? false : true;
     // Deprecated message
     $deprecated_modules_and_links = array('product_info' => '<a href="' . admin_url('admin.php?page=wc-settings&tab=jetpack&wcj-cat=products&section=product_custom_info') . '">' . __('Product Info', 'woocommerce-jetpack') . '</a>');
     if (array_key_exists($current_section, $deprecated_modules_and_links)) {
         echo '<div id="wcj_message" class="error">';
         echo '<p>';
         echo '<strong>';
         echo sprintf(__('Please note that current <em>%s</em> module is deprecated and will be removed in future updates. Please use <em>%s</em> module instead.', 'woocommerce-jetpack'), WCJ()->modules[$current_section]->short_desc, $deprecated_modules_and_links[$current_section]);
         echo '</strong>';
         echo '</p>';
         echo '</div>';
     }
     // Multicurrency message
     /* $multicurrency_modules_enabled = 0;
     		$multicurrency_modules_titles = array();
     		$multicurrency_modules = array( 'price_by_country', 'multicurrency', 'payment_gateways_currency' );
     		foreach ( $multicurrency_modules as $multicurrency_module ) {
     			if ( wcj_is_module_enabled( $multicurrency_module ) ) {
     				$multicurrency_modules_enabled++;
     				$multicurrency_modules_titles[] = WCJ()->modules[ $multicurrency_module ]->short_desc;
     			}
     		}
     		if ( $multicurrency_modules_enabled > 1 ) {
     			echo '<div id="wcj_message" class="error">';
     			echo '<p>';
     			echo '<strong>';
     			echo sprintf( __( 'Please note that only single multicurrency module can be enabled simultaneously. You have <em>%s</em> modules enabled, please choose one of them.', 'woocommerce-jetpack' ), implode( ', ', $multicurrency_modules_titles ) );
     			echo '</strong>';
     			echo '</p>';
     			echo '</div>';
     		} */
     // Caching message
     /* $known_caching_plugins = array( 'w3-total-cache/w3-total-cache.php' );
     		$no_caching_modules = array();
     //		$no_caching_modules = array_merge( $no_caching_modules, $multicurrency_modules );
     		$caching_plugin_is_active = false;
     		foreach ( $known_caching_plugins as $caching_plugin ) {
     			// Check if caching_plugin is active
     			if (
     				in_array( $caching_plugin, apply_filters( 'active_plugins', get_option( 'active_plugins', array() ) ) ) ||
     				( is_multisite() && array_key_exists( $caching_plugin, get_site_option( 'active_sitewide_plugins', array() ) ) )
     			) {
     				$caching_plugin_is_active = true;
     				break;
     			}
     		}
     		$no_caching_module_is_active = false;
     		$no_caching_modules_titles = array();
     		foreach ( $no_caching_modules as $no_caching_module ) {
     			if ( wcj_is_module_enabled( $no_caching_module ) ) {
     				$no_caching_module_is_active = true;
     				$no_caching_modules_titles[] = WCJ()->modules[ $no_caching_module ]->short_desc;
     				//break;
     			}
     		}
     		if ( $caching_plugin_is_active && $no_caching_module_is_active ) {
     			echo '<div id="wcj_message" class="error">';
     			echo '<p>';
     			echo '<strong>';
     			echo sprintf( __( 'Please note that <em>%s</em> modules require caching to be turned off.', 'woocommerce-jetpack' ), implode( ', ', $no_caching_modules_titles ) );
     			echo '</strong>';
     			echo '</p>';
     			echo '</div>';
     		} */
     if ('yes' === get_option('wcj_admin_tools_enabled') && 'yes' === get_option('wcj_debuging_enabled', 'no')) {
         // Breadcrumbs
         $breadcrumbs_html = '';
         $breadcrumbs_html .= '<p>';
         $breadcrumbs_html .= '<code>';
         $breadcrumbs_html .= __('WooCommerce', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         $breadcrumbs_html .= __('Settings', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         $breadcrumbs_html .= __('Booster', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         foreach ($this->cats as $id => $label_info) {
             if ($this->get_cat_by_section($current_section) === $id) {
                 $breadcrumbs_html .= $label_info['label'];
                 break;
             }
         }
         //$breadcrumbs_html .= $settings[0]['title'];
         if (!$is_dashboard) {
             $breadcrumbs_html .= ' > ';
             $sections = $this->get_sections();
             $breadcrumbs_html .= $sections[$current_section];
         }
         $breadcrumbs_html .= '</code>';
         $breadcrumbs_html .= '</p>';
         echo $breadcrumbs_html;
     }
     $settings = $this->get_settings($current_section);
     if (!$is_dashboard) {
         WC_Admin_Settings::output_fields($settings);
     } else {
         $this->output_dashboard($current_section);
     }
 }
示例#17
0
 /**
  * Settings page content.
  *
  * Output settings page content via WooCommerce output_fields() method.
  *
  * @since 1.0.0
  */
 public function woocommerce_settings_page()
 {
     WC_Admin_Settings::output_fields($this->woocommerce_get_settings());
 }
 /**
  * Output the settings
  *
  * @since 1.0
  */
 public function output()
 {
     global $current_section;
     // Load providers so we can show any global options they may have
     $providers = wc_social_login()->get_providers();
     if ($current_section) {
         foreach ($providers as $provider) {
             if (strtolower(get_class($provider)) == strtolower($current_section)) {
                 $provider->admin_options();
                 break;
             }
         }
     } else {
         $settings = $this->get_settings();
         WC_Admin_Settings::output_fields($settings);
     }
 }
    exit;
    // Exit if accessed directly
}
?>

<div class="wc-gzd-admin-settings wc-gzd-admin-settings-<?php 
echo sanitize_title($current_section);
?>
 <?php 
echo apply_filters('woocommerce_gzd_settings_wrapper_' . $current_section, '');
?>
">
	<?php 
do_action('wc_germanized_settings_section_before_' . sanitize_title($current_section));
?>
	<?php 
if (apply_filters('wc_germanized_show_settings_' . sanitize_title($current_section), true)) {
    ?>
		<?php 
    WC_Admin_Settings::output_fields($settings);
    ?>
	<?php 
}
?>
	<?php 
do_action('wc_germanized_settings_section_after_' . sanitize_title($current_section));
?>
</div>

<?php 
echo $sidebar;
示例#20
0
/**
 * Display this plugin's admin settings
 *
 * Hooks into WC's settings api
 * which allows for building, saving, and retrieval of options
 *
 * @since 3.0.0
 */
function display_settings()
{
    \WC_Admin_Settings::output_fields(get_settings());
}
 /**
  * Render the settings for the current section
  *
  * @since 2.0.0
  */
 public function output()
 {
     $settings = $this->get_settings();
     // inject the actual setting value before outputting the fields
     // ::output_fields() uses get_option() but customizations are stored
     // in a single option so this dynamically returns the correct value
     if (isset($_GET['section']) && $_GET['section'] == 'email_options') {
         // email options
         $wc_emails = (array) WC_Emails::instance()->emails;
         foreach (self::$wc_emails_enabled as $filed => $id) {
             $email_enabled = (array) $wc_emails[$filed];
             if ($email_enabled['enabled'] == 'no') {
                 add_filter("pre_option_{$filed}", function () {
                     return 'no';
                 });
             } else {
                 add_filter("pre_option_{$filed}", function () {
                     return 'yes';
                 });
             }
         }
     }
     if (isset($_GET['section']) && $_GET['section'] == 'sms_options') {
     }
     foreach ($this->customizations as $filter => $value) {
         add_filter("pre_option_{$filter}", array($this, 'get_customization'));
     }
     WC_Admin_Settings::output_fields($settings);
 }
 /**
  * Output the settings.
  */
 public function output()
 {
     $settings = $this->get_settings();
     WC_Admin_Settings::output_fields($settings);
 }
 /**
  * Output the settings
  */
 public function output()
 {
     global $current_section;
     $settings = $this->get_settings($current_section);
     WC_Admin_Settings::output_fields($settings);
     $this->wc_enqueue_js("\r\n\t \t\t\t(function(\$){\r\n\t \t\t\t\t\r\n\t \t\t\t\t\$(document).ready(function() {\r\n\t \t\t\t\t\tSS_WC_MailChimp.init();\r\n\t \t\t\t\t});\r\n\r\n\t \t\t\t})(jQuery);\r\n\t\t\t");
     do_action('ss_wc_mailchimp_after_settings_enqueue_js');
 }
 /**
  * Shipping validation settings.
  *
  * Add the settings to the shipping validation shipping section.
  *
  * @since 1.0.0
  *
  * @param  string  $current_section  Slug of the current section
  */
 public function shipping_validation_section_settings($current_section)
 {
     global $current_section;
     if ('shipping_validation' !== $current_section) {
         return;
     }
     $settings = $this->get_settings();
     WC_Admin_Settings::output_fields($settings);
 }
 /**
  * Output the settings.
  */
 public function output()
 {
     global $current_section;
     if ('webhooks' == $current_section) {
         WC_Admin_Webhooks::page_output();
     } elseif ('keys' === $current_section) {
         WC_Admin_API_Keys::page_output();
     } else {
         $settings = $this->get_settings($current_section);
         WC_Admin_Settings::output_fields($settings);
     }
 }
 /**
  * Output the settings.
  *
  * @version 2.4.0
  */
 function output()
 {
     global $current_section, $wcj_notice;
     if ('' != $wcj_notice) {
         echo '<div id="wcj_message" class="updated"><p><strong>' . $wcj_notice . '</strong></p></div>';
     }
     $is_dashboard = '' != $current_section && 'alphabetically' != $current_section && 'by_category' != $current_section && 'active' != $current_section ? false : true;
     $depreciated_modules = array('product_info' => 'Product Info V2');
     if (array_key_exists($current_section, $depreciated_modules)) {
         echo '<div id="wcj_message" class="error">';
         echo '<p>';
         echo '<strong>';
         echo sprintf(__('Please note that current module is depreciated and will be removed in future updates. Please use <em>%s</em> module instead.', 'woocommerce-jetpack'), $depreciated_modules[$current_section]);
         echo '</strong>';
         echo '</p>';
         echo '</div>';
     }
     if ('yes' === get_option('wcj_admin_tools_enabled') && 'yes' === get_option('wcj_debuging_enabled', 'no')) {
         // Breadcrumbs
         $breadcrumbs_html = '';
         $breadcrumbs_html .= '<p>';
         $breadcrumbs_html .= '<code>';
         $breadcrumbs_html .= __('WooCommerce', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         $breadcrumbs_html .= __('Settings', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         $breadcrumbs_html .= __('Booster', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         foreach ($this->cats as $id => $label_info) {
             if ($this->get_cat_by_section($current_section) === $id) {
                 $breadcrumbs_html .= $label_info['label'];
                 break;
             }
         }
         //$breadcrumbs_html .= $settings[0]['title'];
         if (!$is_dashboard) {
             $breadcrumbs_html .= ' > ';
             $sections = $this->get_sections();
             $breadcrumbs_html .= $sections[$current_section];
         }
         $breadcrumbs_html .= '</code>';
         $breadcrumbs_html .= '</p>';
         echo $breadcrumbs_html;
     }
     $settings = $this->get_settings($current_section);
     if (!$is_dashboard) {
         WC_Admin_Settings::output_fields($settings);
     } else {
         $this->output_dashboard($current_section);
     }
 }
 /**
  * Output the settings.
  *
  * @version 2.2.4
  */
 function output()
 {
     global $current_section;
     $is_dashboard = '' != $current_section && 'alphabetically' != $current_section && 'by_category' != $current_section && 'active' != $current_section ? false : true;
     if ('yes' === get_option('wcj_admin_tools_enabled') && 'yes' === get_option('wcj_debuging_enabled', 'no')) {
         // Breadcrumbs
         $breadcrumbs_html = '';
         $breadcrumbs_html .= '<p>';
         $breadcrumbs_html .= '<code>';
         $breadcrumbs_html .= __('WooCommerce', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         $breadcrumbs_html .= __('Settings', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         $breadcrumbs_html .= __('Booster', 'woocommerce-jetpack');
         $breadcrumbs_html .= ' > ';
         foreach ($this->cats as $id => $label_info) {
             if ($this->get_cat_by_section($current_section) === $id) {
                 $breadcrumbs_html .= $label_info['label'];
                 break;
             }
         }
         //$breadcrumbs_html .= $settings[0]['title'];
         if (!$is_dashboard) {
             $breadcrumbs_html .= ' > ';
             $sections = $this->get_sections();
             $breadcrumbs_html .= $sections[$current_section];
         }
         $breadcrumbs_html .= '</code>';
         $breadcrumbs_html .= '</p>';
         echo $breadcrumbs_html;
     }
     $settings = $this->get_settings($current_section);
     if (!$is_dashboard) {
         WC_Admin_Settings::output_fields($settings);
     } else {
         $this->output_dashboard($current_section);
     }
 }