Пример #1
0
 /**
  * Default options
  *
  * Sets up the default options used on the settings page
  *
  * @access public
  */
 function create_options()
 {
     include_once WC()->plugin_path() . '/includes/admin/settings/class-wc-settings-page.php';
     include_once WC_germanized()->plugin_path() . '/includes/admin/settings/class-wc-gzd-settings-germanized.php';
     $settings = new WC_GZD_Settings_Germanized();
     $options = $settings->get_settings();
     if (get_option('woocommerce_gzdp_invoice_enable') != 'no') {
         $invoices = WC_GZDP_Invoice_Helper::instance();
         $options = array_merge($options, $invoices->get_settings());
     }
     foreach ($options as $value) {
         if (isset($value['id']) && strpos($value['id'], 'gzdp') !== false && isset($value['default'])) {
             $autoload = isset($value['autoload']) ? (bool) $value['autoload'] : true;
             add_option($value['id'], $value['default'], '', $autoload ? 'yes' : 'no');
         }
     }
 }
Пример #2
0
 /**
  * Default options
  *
  * Sets up the default options used on the settings page
  *
  * @access public
  */
 function create_options()
 {
     // Include settings so that we can run through defaults
     include_once WC()->plugin_path() . '/includes/admin/settings/class-wc-settings-page.php';
     include_once 'admin/settings/class-wc-gzd-settings-germanized.php';
     $settings = new WC_GZD_Settings_Germanized();
     $options = array_merge($settings->get_settings(), $settings->get_display_settings());
     foreach ($options as $value) {
         if (isset($value['default']) && isset($value['id'])) {
             $autoload = isset($value['autoload']) ? (bool) $value['autoload'] : true;
             add_option($value['id'], $value['default'], '', $autoload ? 'yes' : 'no');
         }
     }
 }