コード例 #1
0
        if ($args['content'] != 'invoice') {
            return;
        }
        if ($args['format'] == 'csv') {
            $export = new WC_GZDP_Admin_Invoice_Export($args);
        } else {
            if ($args['format'] == 'zip') {
                $export = new WC_GZDP_Admin_Invoice_Export_Attachments($args);
            }
        }
        exit;
    }
    public function get_fonts()
    {
        return array('courier' => _x('Courier', 'font-name', 'woocommerce-germanized-pro'), 'helvetica' => _x('Helvetica', 'font-name', 'woocommerce-germanized-pro'), 'times' => _x('Times New Roman', 'font-name', 'woocommerce-germanized-pro'));
    }
    public function get_pdf_version($file)
    {
        $content = file_get_contents($file);
        if (!$content) {
            return false;
        }
        preg_match('/\\d\\.\\d/', substr($content, 0, 10), $match);
        if (isset($match[0])) {
            return $match[0];
        }
        return false;
    }
}
WC_GZDP_Invoice_Helper::instance();
コード例 #2
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');
         }
     }
 }