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

PHP woo_ce_get_option函数代码示例

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

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



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

示例1: woo_ce_generate_csv_filename

function woo_ce_generate_csv_filename($export_type = '')
{
    // Get the filename from WordPress options
    $filename = woo_ce_get_option('export_filename', 'woo-export_%dataset%-%date%.csv');
    // Strip other file extensions if present
    $filename = str_replace(array('xml', 'xls'), 'csv', $filename);
    if (strpos($filename, '.xml') !== false || strpos($filename, '.xls') !== false) {
        $filename = str_replace(array('.xml', '.xls'), '.csv', $filename);
    }
    // Add file extension if it has been removed
    if (strpos($filename, '.csv') === false) {
        $filename .= '.csv';
    }
    // Populate the available tags
    $date = date('Y_m_d');
    $time = date('H_i_s');
    $store_name = sanitize_title(get_bloginfo('name'));
    // Switch out the tags for filled values
    $filename = str_replace('%dataset%', $export_type, $filename);
    $filename = str_replace('%date%', $date, $filename);
    $filename = str_replace('%time%', $time, $filename);
    $filename = str_replace('%store_name%', $store_name, $filename);
    // Return the filename
    return $filename;
}
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:25,代码来源:export-csv.php


示例2: woo_ce_override_product_vendor_field_labels

function woo_ce_override_product_vendor_field_labels($fields = array())
{
    $labels = woo_ce_get_option('product_vendor_labels', array());
    if (!empty($labels)) {
        foreach ($fields as $key => $field) {
            if (isset($labels[$field['name']])) {
                $fields[$key]['label'] = $labels[$field['name']];
            }
        }
    }
    return $fields;
}
开发者ID:mynein,项目名称:myne,代码行数:12,代码来源:product_vendor.php


示例3: woo_ce_get_coupon_fields

function woo_ce_get_coupon_fields($format = 'full')
{
    $fields = array();
    $fields[] = array('name' => 'coupon_code', 'label' => __('Coupon Code', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'coupon_description', 'label' => __('Coupon Description', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'discount_type', 'label' => __('Discount Type', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'coupon_amount', 'label' => __('Coupon Amount', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'individual_use', 'label' => __('Individual Use', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'apply_before_tax', 'label' => __('Apply before tax', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'exclude_sale_items', 'label' => __('Exclude sale items', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'minimum_amount', 'label' => __('Minimum Amount', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'product_ids', 'label' => __('Products', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'exclude_product_ids', 'label' => __('Exclude Products', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'product_categories', 'label' => __('Product Categories', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'exclude_product_categories', 'label' => __('Exclude Product Categories', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'customer_email', 'label' => __('Customer e-mails', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'usage_limit', 'label' => __('Usage Limit', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'expiry_date', 'label' => __('Expiry Date', 'woo_ce'), 'default' => 1);
    /*
    	$fields[] = array(
    		'name' => '',
    		'label' => __( '', 'woo_ce' ),
    		'default' => 1
    	);
    */
    // Allow Plugin/Theme authors to add support for additional Coupon columns
    $fields = apply_filters('woo_ce_coupon_fields', $fields);
    if ($remember = woo_ce_get_option('coupons_fields')) {
        $remember = maybe_unserialize($remember);
        $size = count($fields);
        for ($i = 0; $i < $size; $i++) {
            if (!array_key_exists($fields[$i]['name'], $remember)) {
                $fields[$i]['default'] = 0;
            }
        }
    }
    switch ($format) {
        case 'summary':
            $output = array();
            $size = count($fields);
            for ($i = 0; $i < $size; $i++) {
                $output[$fields[$i]['name']] = 'on';
            }
            return $output;
            break;
        case 'full':
        default:
            return $fields;
            break;
    }
}
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:51,代码来源:functions-coupons.php


示例4: woo_ce_get_category_fields

function woo_ce_get_category_fields($format = 'full')
{
    $fields = array();
    $fields[] = array('name' => 'term_id', 'label' => __('Term ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'name', 'label' => __('Category Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'slug', 'label' => __('Category Slug', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'parent_id', 'label' => __('Parent Term ID', 'woo_ce'), 'default' => 1);
    /*
    	$fields[] = array(
    		'name' => '',
    		'label' => __( '', 'woo_ce' ),
    		'default' => 1
    	);
    */
    // Allow Plugin/Theme authors to add support for additional Category columns
    $fields = apply_filters('woo_ce_category_fields', $fields);
    if ($remember = woo_ce_get_option('categories_fields', array())) {
        $remember = maybe_unserialize($remember);
        $size = count($fields);
        for ($i = 0; $i < $size; $i++) {
            $fields[$i]['disabled'] = 0;
            if (!array_key_exists($fields[$i]['name'], $remember)) {
                $fields[$i]['default'] = 0;
            }
        }
    }
    switch ($format) {
        case 'summary':
            $output = array();
            $size = count($fields);
            for ($i = 0; $i < $size; $i++) {
                $output[$fields[$i]['name']] = 'on';
            }
            return $output;
            break;
        case 'full':
        default:
            return $fields;
            break;
    }
}
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:41,代码来源:functions-categories.php


示例5: woo_ce_user_extend

function woo_ce_user_extend( $user ) {

	// WooCommerce Hear About Us - https://wordpress.org/plugins/woocommerce-hear-about-us/
	if( class_exists( 'WooCommerce_HearAboutUs' ) ) {
		$source = get_user_meta( $user->ID, '_wchau_source', true );
		if( $source == '' )
			$source = __( 'N/A', 'woo_ce' );
		$user->hear_about_us = $source;
		unset( $source );
	}

	// WooCommerce User Profile fields
	if( class_exists( 'WC_Admin_Profile' ) ) {
		$admin_profile = new WC_Admin_Profile();
		if( $show_fields = $admin_profile->get_customer_meta_fields() ) {
			foreach( $show_fields as $fieldset ) {
				foreach( $fieldset['fields'] as $key => $field )
					$user->{$key} = esc_attr( get_user_meta( $user->ID, $key, true ) );
			}
		}
		unset( $show_fields, $fieldset, $field );
	}

	// Custom User fields
	$custom_users = woo_ce_get_option( 'custom_users', '' );
	if( !empty( $custom_users ) ) {
		foreach( $custom_users as $custom_user ) {
			// Check that the custom User name is filled and it hasn't previously been set
			if( !empty( $custom_user ) && !isset( $user->{$custom_user} ) ) {
				$user->{$custom_user} = woo_ce_format_custom_meta( get_user_meta( $user->ID, $custom_user, true ) );
			}
		}
	}
	unset( $custom_users, $custom_user );

	return $user;

}
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:38,代码来源:user.php


示例6: woo_ce_memory_prompt

    function woo_ce_memory_prompt()
    {
        if (!woo_ce_get_option('dismiss_memory_prompt', 0)) {
            $memory_limit = (int) ini_get('memory_limit');
            $minimum_memory_limit = 64;
            if ($memory_limit < $minimum_memory_limit) {
                ob_start();
                $memory_url = add_query_arg('action', 'dismiss_memory_prompt');
                $message = sprintf(__('We recommend setting memory to at least %dMB, your site has %dMB currently allocated. See: <a href="%s" target="_blank">Increasing memory allocated to PHP</a>', 'woo_ce'), $minimum_memory_limit, $memory_limit, 'http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP');
                ?>
<div class="error settings-error">
	<p>
		<strong><?php 
                echo $message;
                ?>
</strong>
		<span style="float:right;"><a href="<?php 
                echo $memory_url;
                ?>
"><?php 
                _e('Dismiss', 'woo_ce');
                ?>
</a></span>
	</p>
</div>
<?php 
                ob_end_flush();
            }
        }
    }
开发者ID:jaiweb,项目名称:ASP,代码行数:30,代码来源:functions.php


示例7: woo_ce_trigger_new_order_export

function woo_ce_trigger_new_order_export( $order_id = 0 ) {

	global $export;

	if( !empty( $order_id ) ) {
		$export_format = woo_ce_get_option( 'trigger_new_order_format', 'csv' );
		$export_fields = woo_ce_get_option( 'trigger_new_order_fields', 'all' );
		$gui = woo_ce_get_option( 'trigger_new_order_method', 'archive' );
		set_transient( WOO_CD_PREFIX . '_single_export_format', sanitize_text_field( $export_format ), MINUTE_IN_SECONDS );
		set_transient( WOO_CD_PREFIX . '_single_export_order_ids', absint( $order_id ), MINUTE_IN_SECONDS );
		set_transient( WOO_CD_PREFIX . '_single_export_fields', sanitize_text_field( $export_fields ), MINUTE_IN_SECONDS );
		$export_type = 'order';
		if( woo_ce_cron_export( $gui, $export_type ) ) {
			error_log( sprintf( '[store-exporter-deluxe] %s: Success: %s', $export->filename, sprintf( __( 'New Order #%d export saved to WordPress Media', 'woo_ce' ), $order_id ) ) );
		}
		delete_transient( WOO_CD_PREFIX . '_single_export_format' );
		delete_transient( WOO_CD_PREFIX . '_single_export_order_ids' );
		delete_transient( WOO_CD_PREFIX . '_single_export_fields' );
		unset( $gui, $export_type );
	}

}
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:22,代码来源:cron.php


示例8: woo_ce_memory_prompt

 function woo_ce_memory_prompt()
 {
     if (!woo_ce_get_option('dismiss_memory_prompt', 0)) {
         $memory_limit = (int) ini_get('memory_limit');
         $minimum_memory_limit = 64;
         if ($memory_limit < $minimum_memory_limit) {
             $memory_url = add_query_arg('action', 'dismiss_memory_prompt');
             $troubleshooting_url = 'http://www.visser.com.au/documentation/store-exporter-deluxe/usage/';
             $message = sprintf(__('We recommend setting memory to at least %dMB, your site has only %dMB allocated to it. See: <a href="%s" target="_blank">Increasing memory allocated to PHP</a>', 'woo_ce'), $minimum_memory_limit, $memory_limit, $troubleshooting_url) . '<span style="float:right;"><a href="' . $memory_url . '">' . __('Dismiss', 'woo_ce') . '</a></span>';
             woo_ce_admin_notice($message, 'error');
         }
     }
 }
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:13,代码来源:functions.php


示例9: woo_ce_extend_product_item

function woo_ce_extend_product_item($product, $product_id)
{
    // Custom Product meta
    $custom_products = woo_ce_get_option('custom_products', '');
    if (!empty($custom_products)) {
        foreach ($custom_products as $custom_product) {
            // Check that the custom Product name is filled and it hasn't previously been set
            if (!empty($custom_product) && !isset($product->{$custom_product})) {
                $product->{$custom_product} = get_post_meta($product_id, $custom_product, true);
            }
        }
    }
    return $product;
}
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:14,代码来源:product.php


示例10: woo_ce_extend_user_fields

function woo_ce_extend_user_fields($fields = array())
{
    // WooCommerce User fields
    if (class_exists('WC_Admin_Profile')) {
        $admin_profile = new WC_Admin_Profile();
        if (method_exists('WC_Admin_Profile', 'get_customer_meta_fields')) {
            $show_fields = $admin_profile->get_customer_meta_fields();
            foreach ($show_fields as $fieldset) {
                foreach ($fieldset['fields'] as $key => $field) {
                    $fields[] = array('name' => $key, 'label' => sprintf(apply_filters('woo_ce_extend_user_fields_wc', '%s: %s'), $fieldset['title'], esc_html($field['label'])), 'disabled' => 1);
                }
            }
            unset($show_fields, $fieldset, $field);
        }
    }
    // Custom User meta
    $custom_users = woo_ce_get_option('custom_users', '');
    if (!empty($custom_users)) {
        foreach ($custom_users as $custom_user) {
            if (!empty($custom_user)) {
                $fields[] = array('name' => $custom_user, 'label' => $custom_user, 'disabled' => 1);
            }
        }
        unset($custom_users, $custom_user);
    }
    return $fields;
}
开发者ID:mynein,项目名称:myne,代码行数:27,代码来源:user.php


示例11: woo_ce_extend_order_items_unique_columns


//.........这里部分代码省略.........
	if( class_exists( 'WooCommerce_Product_Vendors' ) ) {
		if( isset( $original_columns[sprintf( 'order_item_%d_vendor', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_vendor', 'name', 'unique' ) );
	}

	// Cost of Goods - http://www.skyverge.com/product/woocommerce-cost-of-goods-tracking/
	if( class_exists( 'WC_COG' ) ) {
		if( isset( $original_columns[sprintf( 'order_item_%d_cost_of_goods', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_cost_of_goods', 'name', 'unique' ) );
		if( isset( $original_columns[sprintf( 'order_item_%d_total_cost_of_goods', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_total_cost_of_goods', 'name', 'unique' ) );
	}

	// WooCommerce MSRP Pricing - http://woothemes.com/woocommerce/
	if( function_exists( 'woocommerce_msrp_activate' ) ) {
		if( isset( $original_columns[sprintf( 'order_item_%d_msrp', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_msrp', 'name', 'unique' ) );
	}

	// Gravity Forms - http://woothemes.com/woocommerce
	if( class_exists( 'RGForms' ) && class_exists( 'woocommerce_gravityforms' ) ) {
		if( isset( $original_columns[sprintf( 'order_item_%d_gf_form_id', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_gf_form_id', 'name', 'unique' ) );
		if( isset( $original_columns[sprintf( 'order_item_%d_gf_form_label', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_gf_form_label', 'name', 'unique' ) );
		// Check if there are any Products linked to Gravity Forms
		if( $gf_fields = woo_ce_get_gravity_form_fields() ) {
			foreach( $gf_fields as $key => $gf_field ) {
				if( isset( $original_columns[sprintf( 'order_item_%d_gf_%d_%s', $i, $gf_field['formId'], $gf_field['id'] )] ) )
					$fields[] = sprintf( apply_filters( 'woo_ce_extend_order_items_unique_columns_gf_fields', __( 'Order Item #%d: %s - %s', 'woo_ce' ) ), $i, $gf_field['formTitle'], $gf_field['label'] );
			}
		}
	}

	// Local Pickup Plus - http://www.woothemes.com/products/local-pickup-plus/
	if( class_exists( 'WC_Local_Pickup_Plus' ) ) {
		if( isset( $original_columns[sprintf( 'order_item_%d_pickup_location', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_pickup_location', 'name', 'unique' ) );
	}

	// WooCommerce Bookings - http://www.woothemes.com/products/woocommerce-bookings/
	if( class_exists( 'WC_Bookings' ) ) {
		if( isset( $original_columns[sprintf( 'order_item_%d_booking_id', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_booking_id', 'name', 'unique' ) );
		if( isset( $original_columns[sprintf( 'order_item_%d_booking_date', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_booking_date', 'name', 'unique' ) );
		if( isset( $original_columns[sprintf( 'order_item_%d_booking_type', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_booking_type', 'name', 'unique' ) );
		if( isset( $original_columns[sprintf( 'order_item_%d_booking_start_date', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_booking_start_date', 'name', 'unique' ) );
		if( isset( $original_columns[sprintf( 'order_item_%d_booking_end_date', $i )] ) )
			$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, woo_ce_get_order_field( 'order_items_booking_end_date', 'name', 'unique' ) );
	}

	// WooCommerce TM Extra Product Options - http://codecanyon.net/item/woocommerce-extra-product-options/7908619
	if( class_exists( 'TM_Extra_Product_Options' ) ) {
		if( $tm_fields = woo_ce_get_extra_product_option_fields() ) {
			foreach( $tm_fields as $tm_field ) {
				if( isset( $original_columns[sprintf( 'order_item_%d_tm_%s', $i, sanitize_key( $tm_field['name'] ) )] ) )
					$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, $tm_field['name'] );
			}
		}
	}

	// Attributes
	if( $attributes = woo_ce_get_product_attributes() ) {
		foreach( $attributes as $attribute ) {
			if( isset( $original_columns[sprintf( 'order_item_%d_attribute_%s', $i, sanitize_key( $attribute->attribute_name ) )] ) ) {
				if( empty( $attribute->attribute_label ) )
					$attribute->attribute_label = $attribute->attribute_name;
				$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, $attribute->attribute_label );
			}
		}
	}

	// Custom Order Items fields
	$custom_order_items = woo_ce_get_option( 'custom_order_items', '' );
	if( !empty( $custom_order_items ) ) {
		foreach( $custom_order_items as $custom_order_item ) {
			if( !empty( $custom_order_item ) ) {
				if( isset( $original_columns[sprintf( 'order_item_%d_%s', $i, $custom_order_item )] ) )
					$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, $custom_order_item );
			}
		}
	}

	// Custom Product fields
	$custom_products = woo_ce_get_option( 'custom_products', '' );
	if( !empty( $custom_products ) ) {
		foreach( $custom_products as $custom_product ) {
			if( !empty( $custom_product ) ) {
				if( isset( $original_columns[sprintf( 'order_item_%d_%s', $i, $custom_product )] ) )
					$fields[] = sprintf( __( 'Order Item #%d: %s', 'woo_ce' ), $i, $custom_product );
			}
		}
	}

	return $fields;

}
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:101,代码来源:order.php


示例12: woo_ce_admin_save_settings

function woo_ce_admin_save_settings() {

	// Strip file extension from export filename
	$export_filename = strip_tags( $_POST['export_filename'] );
	if( ( strpos( $export_filename, '.csv' ) !== false ) || ( strpos( $export_filename, '.xml' ) !== false ) || ( strpos( $export_filename, '.xls' ) !== false ) )
		$export_filename = str_replace( array( '.csv', '.xml', '.xls' ), '', $export_filename );
	woo_ce_update_option( 'export_filename', $export_filename );
	woo_ce_update_option( 'delete_file', absint( $_POST['delete_file'] ) );
	woo_ce_update_option( 'encoding', sanitize_text_field( $_POST['encoding'] ) );
	woo_ce_update_option( 'delimiter', sanitize_text_field( $_POST['delimiter'] ) );
	woo_ce_update_option( 'category_separator', sanitize_text_field( $_POST['category_separator'] ) );
	woo_ce_update_option( 'bom', absint( $_POST['bom'] ) );
	woo_ce_update_option( 'escape_formatting', sanitize_text_field( $_POST['escape_formatting'] ) );
	woo_ce_update_option( 'header_formatting', absint( $_POST['header_formatting'] ) );
	if( $_POST['date_format'] == 'custom' && !empty( $_POST['date_format_custom'] ) )
		woo_ce_update_option( 'date_format', sanitize_text_field( $_POST['date_format_custom'] ) );
	else
		woo_ce_update_option( 'date_format', sanitize_text_field( $_POST['date_format'] ) );
	woo_ce_update_option( 'email_to', sanitize_text_field( $_POST['email_to'] ) );
	woo_ce_update_option( 'email_subject', sanitize_text_field( $_POST['email_subject'] ) );
	woo_ce_update_option( 'post_to', sanitize_text_field( $_POST['post_to'] ) );

	// XML settings
	woo_ce_update_option( 'xml_attribute_url', ( isset( $_POST['xml_attribute_url'] ) ? absint( $_POST['xml_attribute_url'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_title', ( isset( $_POST['xml_attribute_title'] ) ? absint( $_POST['xml_attribute_title'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_date', ( isset( $_POST['xml_attribute_date'] ) ? absint( $_POST['xml_attribute_date'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_time', ( isset( $_POST['xml_attribute_time'] ) ? absint( $_POST['xml_attribute_time'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_export', ( isset( $_POST['xml_attribute_export'] ) ? absint( $_POST['xml_attribute_export'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_orderby', ( isset( $_POST['xml_attribute_orderby'] ) ? absint( $_POST['xml_attribute_orderby'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_order', ( isset( $_POST['xml_attribute_order'] ) ? absint( $_POST['xml_attribute_order'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_limit', ( isset( $_POST['xml_attribute_limit'] ) ? absint( $_POST['xml_attribute_limit'] ) : 0 ) );
	woo_ce_update_option( 'xml_attribute_offset', ( isset( $_POST['xml_attribute_offset'] ) ? absint( $_POST['xml_attribute_offset'] ) : 0 ) );

	// RSS settings
	woo_ce_update_option( 'rss_title', ( isset( $_POST['rss_title'] ) ? sanitize_text_field( $_POST['rss_title'] ) : '' ) );
	woo_ce_update_option( 'rss_link', ( isset( $_POST['rss_link'] ) ? esc_url_raw( $_POST['rss_link'] ) : '' ) );
	woo_ce_update_option( 'rss_description', ( isset( $_POST['rss_description'] ) ? sanitize_text_field( $_POST['rss_description'] ) : '' ) );

	// Scheduled export settings
	$enable_auto = absint( $_POST['enable_auto'] );
	$auto_schedule = sanitize_text_field( $_POST['auto_schedule'] );
	$auto_interval = absint( $_POST['auto_interval'] );
	$auto_commence = sanitize_text_field( $_POST['auto_commence'] );
	$auto_commence_date = sanitize_text_field( $_POST['auto_commence_date'] );
	$site_hash = md5( get_option( 'siteurl' ) );

	// Display additional notice if Enabled Scheduled Exports is enabled/disabled or scheduling options are modified
	if( 
		woo_ce_get_option( 'enable_auto', 0 ) <> $enable_auto || 
		woo_ce_get_option( 'auto_schedule', 'custom' ) <> $auto_schedule || 
		woo_ce_get_option( 'auto_interval', 1440 ) <> $auto_interval || 
		woo_ce_get_option( 'auto_commence', 'now' ) <> $auto_commence || 
		woo_ce_get_option( 'auto_commence_date', date( 'd/m/Y H:i' ) ) <> $auto_commence_date
	) {

		// Save these fields before we re-load the WP-CRON schedule
		woo_ce_update_option( 'enable_auto', $enable_auto );

		// Remove from WP-CRON schedule if disabled
		if( $enable_auto == 0 ) {
			woo_ce_cron_activation();
		// Re-load the WP-CRON schedule with our new scheduling options
		} else if( 
			woo_ce_get_option( 'auto_schedule', 'custom' ) <> $auto_schedule || 
			woo_ce_get_option( 'auto_interval', 1440 ) <> $auto_interval || 
			woo_ce_get_option( 'auto_commence', 'now' ) <> $auto_commence || 
			woo_ce_get_option( 'auto_commence_date', date( 'd/m/Y H:i' ) ) <> $auto_commence_date || 
			woo_ce_get_option( 'site_hash', '' ) <> $site_hash
		) {
			// Save these fields before we re-load the WP-CRON schedule
			woo_ce_update_option( 'auto_commence', $auto_commence );
			woo_ce_update_option( 'auto_commence_date', $auto_commence_date );
			woo_ce_update_option( 'auto_schedule', $auto_schedule );
			woo_ce_update_option( 'auto_interval', $auto_interval );

			// Update the Site URL hash we use for live vs. staging checks
			woo_ce_update_option( 'site_hash', $site_hash );

			woo_ce_cron_activation( true );
		}

		switch( $auto_schedule ) {

			case 'daily':
			case 'weekly':
			case 'monthly':
				$interval = $auto_schedule;
				break;

			case 'custom':
				$interval = sprintf( __( 'in %d minute(s)', 'woo_ce' ), $auto_interval );
				break;

		}
		switch( $auto_commence ) {

			case 'now':
				$commence = __( ' from now' );
				break;

//.........这里部分代码省略.........
开发者ID:helloworld-digital,项目名称:katemorgan,代码行数:101,代码来源:settings.php


示例13: woo_ce_get_commission_fields

function woo_ce_get_commission_fields($format = 'full')
{
    $export_type = 'commission';
    $fields = array();
    $fields[] = array('name' => 'ID', 'label' => __('Commission ID', 'woo_ce'));
    $fields[] = array('name' => 'post_date', 'label' => __('Commission Date', 'woo_ce'));
    $fields[] = array('name' => 'title', 'label' => __('Commission Title', 'woo_ce'));
    $fields[] = array('name' => 'product_id', 'label' => __('Product ID', 'woo_ce'));
    $fields[] = array('name' => 'product_name', 'label' => __('Product Name', 'woo_ce'));
    $fields[] = array('name' => 'product_sku', 'label' => __('Product SKU', 'woo_ce'));
    $fields[] = array('name' => 'product_vendor_id', 'label' => __('Product Vendor ID', 'woo_ce'));
    $fields[] = array('name' => 'product_vendor_name', 'label' => __('Product Vendor Name', 'woo_ce'));
    $fields[] = array('name' => 'commission_amount', 'label' => __('Commission Amount', 'woo_ce'));
    $fields[] = array('name' => 'paid_status', 'label' => __('Commission Status', 'woo_ce'));
    $fields[] = array('name' => 'post_status', 'label' => __('Post Status', 'woo_ce'));
    /*
    	$fields[] = array(
    		'name' => '',
    		'label' => __( '', 'woo_ce' )
    	);
    */
    // Allow Plugin/Theme authors to add support for additional columns
    $fields = apply_filters('woo_ce_' . $export_type . '_fields', $fields, $export_type);
    switch ($format) {
        case 'summary':
            $output = array();
            $size = count($fields);
            for ($i = 0; $i < $size; $i++) {
                if (isset($fields[$i])) {
                    $output[$fields[$i]['name']] = 'on';
                }
            }
            return $output;
            break;
        case 'full':
        default:
            $sorting = woo_ce_get_option($export_type . '_sorting', array());
            $size = count($fields);
            for ($i = 0; $i < $size; $i++) {
                $fields[$i]['reset'] = $i;
                $fields[$i]['order'] = isset($sorting[$fields[$i]['name']]) ? $sorting[$fields[$i]['name']] : $i;
            }
            // Check if we are using PHP 5.3 and above
            if (version_compare(phpversion(), '5.3') >= 0) {
                usort($fields, woo_ce_sort_fields('order'));
            }
            return $fields;
            break;
    }
}
开发者ID:Junaid-Farid,项目名称:gocnex,代码行数:50,代码来源:commission.php


示例14: woo_ce_admin_init

 function woo_ce_admin_init()
 {
     global $export, $wp_roles;
     include_once 'includes/formatting.php';
     $action = woo_get_action();
     switch ($action) {
         case 'dismiss_memory_prompt':
             woo_ce_update_option('dismiss_memory_prompt', 1);
             $url = add_query_arg('action', null);
             wp_redirect($url);
             exit;
             break;
         case 'export':
             $export = new stdClass();
             $export->start_time = time();
             $export->idle_memory_start = woo_ce_current_memory_usage();
             $export->delimiter = $_POST['delimiter'];
             if ($export->delimiter != woo_ce_get_option('delimiter')) {
                 woo_ce_update_option('delimiter', $export->delimiter);
             }
             $export->category_separator = $_POST['category_separator'];
             if ($export->category_separator != woo_ce_get_option('category_separator')) {
                 woo_ce_update_option('category_separator', $export->category_separator);
             }
             $export->bom = $_POST['bom'];
             if ($export->bom != woo_ce_get_option('bom')) {
                 woo_ce_update_option('bom', $export->bom);
             }
             $export->escape_formatting = $_POST['escape_formatting'];
             if ($export->escape_formatting != woo_ce_get_option('escape_formatting')) {
                 woo_ce_update_option('escape_formatting', $export->escape_formatting);
             }
             $export->limit_volume = -1;
             if (!empty($_POST['limit_volume'])) {
                 $export->limit_volume = $_POST['limit_volume'];
                 if ($export->limit_volume != woo_ce_get_option('limit_volume')) {
                     woo_ce_update_option('limit_volume', $export->limit_volume);
                 }
             }
             $export->offset = 0;
             if (!empty($_POST['offset'])) {
                 $export->offset = (int) $_POST['offset'];
                 if ($export->offset != woo_ce_get_option('offset')) {
                     woo_ce_update_option('offset', $export->offset);
                 }
             }
             $export->delete_temporary_csv = 0;
             if (!empty($_POST['delete_temporary_csv'])) {
                 $export->delete_temporary_csv = (int) $_POST['delete_temporary_csv'];
                 if ($export->delete_temporary_csv != woo_ce_get_option('delete_csv')) {
                     woo_ce_update_option('delete_csv', $export->delete_temporary_csv);
                 }
             }
             $export->encoding = 'UTF-8';
             if (!empty($_POST['encoding'])) {
                 $export->encoding = (string) $_POST['encoding'];
                 if ($export->encoding != woo_ce_get_option('encoding')) {
                     woo_ce_update_option('encoding', $export->encoding);
                 }
             }
             if (!empty($_POST['date_format'])) {
                 $export->date_format = (string) $_POST['date_format'];
                 if ($export->date_format != woo_ce_get_option('date_format')) {
                     woo_ce_update_option('date_format', $export->date_format);
                 }
             }
             $export->fields = false;
             $export->product_categories = false;
             $export->product_tags = false;
             $export->product_status = false;
             $export->product_type = false;
             $export->product_orderby = false;
             $export->product_order = false;
             $export->category_orderby = false;
             $export->category_order = false;
             $export->tag_orderby = false;
             $export->tag_order = false;
             $export->order_dates_filter = false;
             $export->order_dates_from = '';
             $export->order_dates_to = '';
             $export->order_status = false;
             $export->order_customer = false;
             $export->order_user_roles = false;
             $export->order_items = 'combined';
             $export->order_orderby = false;
             $export->order_order = false;
             $export->type = isset($_POST['dataset']) ? $_POST['dataset'] : false;
             switch ($export->type) {
                 case 'products':
                     $export->fields = isset($_POST['product_fields']) ? $_POST['product_fields'] : false;
                     $export->product_categories = isset($_POST['product_filter_categories']) ? woo_ce_format_product_filters($_POST['product_filter_categories']) : false;
                     $export->product_tags = isset($_POST['product_filter_tags']) ? woo_ce_format_product_filters($_POST['product_filter_tags']) : false;
                     $export->product_status = isset($_POST['product_filter_status']) ? woo_ce_format_product_filters($_POST['product_filter_status']) : false;
                     $export->product_type = isset($_POST['product_filter_type']) ? woo_ce_format_product_filters($_POST['product_filter_type']) : false;
                     $export->product_orderby = isset($_POST['product_orderby']) ? $_POST['product_orderby'] : false;
                     if ($export->product_orderby != woo_ce_get_option('product_orderby')) {
                         woo_ce_update_option('product_orderby', $export->product_orderby);
                     }
                     $export->product_order = isset($_POST['product_order']) ? $_POST['product_order'] : false;
                     if ($export->product_order != woo_ce_get_option('product_order')) {
//.........这里部分代码省略.........
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:101,代码来源:exporter.php


示例15: woo_ce_format_description_excerpt

function woo_ce_format_description_excerpt($string = '')
{
    if ($description_excerpt_formatting = woo_ce_get_option('description_excerpt_formatting', 0)) {
        $string = wp_kses($string);
    }
    return $string;
}
开发者ID:mynein,项目名称:myne,代码行数:7,代码来源:formatting.php


示例16: woo_ce_get_order_fields

function woo_ce_get_order_fields($format = 'full')
{
    $fields = array();
    $fields[] = array('name' => 'purchase_id', 'label' => __('Purchase ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'purchase_total', 'label' => __('Order Total', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_discount', 'label' => __('Order Discount', 'woo_ce'), 'default' => 1);
    /*
    	$fields[] = array(
    		'name' => 'order_incl_tax',
    		'label' => __( 'Order Incl. Tax', 'woo_ce' ),
    		'default' => ''
    	);
    */
    $fields[] = array('name' => 'order_excl_tax', 'label' => __('Order Excl. Tax', 'woo_ce'), 'default' => 1);
    /*
    	$fields[] = array(
    		'name' => 'order_tax_rate',
    		'label' => __( 'Order Tax Rate', 'woo_ce' ),
    		'default' => ''
    	);
    */
    $fields[] = array('name' => 'order_sales_tax', 'label' => __('Sales Tax Total', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_shipping_tax', 'label' => __('Shipping Tax Total', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'payment_gateway_id', 'label' => __('Payment Gateway ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'payment_gateway', 'label' => __('Payment Gateway', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_method_id', 'label' => __('Shipping Method ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_method', 'label' => __('Shipping Method', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_cost', 'label' => __('Shipping Cost', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'payment_status', 'label' => __('Payment Status', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_key', 'label' => __('Order Key', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'purchase_date', 'label' => __('Purchase Date', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'purchase_time', 'label' => __('Purchase Time', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'customer_note', 'label' => __('Customer Note', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_notes', 'label' => __('Order Notes', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'user_id', 'label' => __('User ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'user_name', 'label' => __('Username', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'user_role', 'label' => __('User Role', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'ip_address', 'label' => __('Checkout IP Address', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'browser_agent', 'label' => __('Checkout Browser Agent', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_full_name', 'label' => __('Billing: Full Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_first_name', 'label' => __('Billing: First Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_last_name', 'label' => __('Billing: Last Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_company', 'label' => __('Billing: Company', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_address', 'label' => __('Billing: Street Address', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_city', 'label' => __('Billing: City', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_postcode', 'label' => __('Billing: ZIP Code', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_state', 'label' => __('Billing: State (prefix)', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_state_full', 'label' => __('Billing: State', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_country', 'label' => __('Billing: Country (prefix)', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_country_full', 'label' => __('Billing: Country', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_phone', 'label' => __('Billing: Phone Number', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'billing_email', 'label' => __('Billing: E-mail Address', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_full_name', 'label' => __('Shipping: Full Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_first_name', 'label' => __('Shipping: First Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_last_name', 'label' => __('Shipping: Last Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_company', 'label' => __('Shipping: Company', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_address', 'label' => __('Shipping: Street Address', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_city', 'label' => __('Shipping: City', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_postcode', 'label' => __('Shipping: ZIP Code', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_state', 'label' => __('Shipping: State (prefix)', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_state_full', 'label' => __('Shipping: State', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_country', 'label' => __('Shipping: Country (prefix)', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'shipping_country_full', 'label' => __('Shipping: Country', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_product_id', 'label' => __('Order Items: Product ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_variation_id', 'label' => __('Order Items: Variation ID', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_sku', 'label' => __('Order Items: SKU', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_name', 'label' => __('Order Items: Product Name', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_variation', 'label' => __('Order Items: Product Variation', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_tax_class', 'label' => __('Order Items: Tax Class', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_quantity', 'label' => __('Order Items: Quantity', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_total', 'label' => __('Order Items: Total', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_subtotal', 'label' => __('Order Items: Subtotal', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_tax', 'label' => __('Order Items: Tax', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_tax_subtotal', 'label' => __('Order Items: Tax Subtotal', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_type', 'label' => __('Order Items: Type', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_type', 'label' => __('Order Items: Type', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_category', 'label' => __('Order Items: Category', 'woo_ce'), 'default' => 1);
    $fields[] = array('name' => 'order_items_tag', 'label' => __('Order Items: Tag', 'woo_ce'), 'default' => 1);
    /*
    	$fields[] = array(
    		'name' => '',
    		'label' => __( '', 'woo_ce' ),
    		'default' => 1
    	);
    */
    // Allow Plugin/Theme authors to add support for additional Order columns
    $fields = apply_filters('woo_ce_order_fields', $fields);
    if ($remember = woo_ce_get_option('orders_fields')) {
        $remember = maybe_unserialize($remember);
        $size = count($fields);
        for ($i = 0; $i < $size; $i++) {
            if ($fields[$i]) {
                if (!array_key_exists($fields[$i]['name'], $remember)) {
                    $fields[$i]['default'] = 0;
                }
            }
        }
    }
    switch ($format) {
        case 'summary':
//.........这里部分代码省略.........
开发者ID:GarryVeles,项目名称:Artibaltika,代码行数:101,代码来源:functions-orders.php


示例17: woo_ce_get_shipping_class_fields

该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP woo_ce_sort_fields函数代码示例发布时间:2022-05-23
下一篇:
PHP woo_breadcrumbs函数代码示例发布时间: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