2013-06-11 14:59:34 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-11-03 13:53:50 +00:00
|
|
|
* Deprecated functions
|
2013-06-11 14:59:34 +00:00
|
|
|
*
|
|
|
|
* Where functions come to die.
|
|
|
|
*
|
2014-08-07 18:26:05 +00:00
|
|
|
* @author WooThemes
|
2013-06-11 14:59:34 +00:00
|
|
|
* @category Core
|
|
|
|
* @package WooCommerce/Functions
|
|
|
|
* @version 2.1.0
|
|
|
|
*/
|
|
|
|
|
2014-09-20 19:08:35 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2016-11-11 15:31:00 +00:00
|
|
|
exit;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Runs a deprecated action with notice only if used.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @since 3.0.0
|
2016-11-11 15:31:00 +00:00
|
|
|
* @param string $action
|
|
|
|
* @param array $args
|
|
|
|
* @param string $deprecated_in
|
|
|
|
* @param string $replacement
|
|
|
|
*/
|
|
|
|
function wc_do_deprecated_action( $action, $args, $deprecated_in, $replacement ) {
|
|
|
|
if ( has_action( $action ) ) {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'Action: ' . $action, $deprecated_in, $replacement );
|
2016-11-11 15:31:00 +00:00
|
|
|
do_action_ref_array( $action, $args );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2016-11-23 16:15:00 +00:00
|
|
|
* Wrapper for deprecated functions so we can apply some extra logic.
|
2016-11-11 15:31:00 +00:00
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @since 3.0.0
|
2016-11-11 15:31:00 +00:00
|
|
|
* @param string $function
|
|
|
|
* @param string $version
|
|
|
|
* @param string $replacement
|
|
|
|
*/
|
2016-11-23 16:15:00 +00:00
|
|
|
function wc_deprecated_function( $function, $version, $replacement = null ) {
|
|
|
|
if ( is_ajax() ) {
|
2017-01-05 18:54:10 +00:00
|
|
|
do_action( 'deprecated_function_run', $function, $replacement, $version );
|
2016-11-23 17:41:58 +00:00
|
|
|
$log_string = "The {$function} function is deprecated since version {$version}.";
|
2017-01-15 02:21:02 +00:00
|
|
|
$log_string .= $replacement ? " Replace with {$replacement}." : '';
|
2016-11-23 17:41:58 +00:00
|
|
|
error_log( $log_string );
|
2016-11-23 16:15:00 +00:00
|
|
|
} else {
|
2016-11-11 15:31:00 +00:00
|
|
|
_deprecated_function( $function, $version, $replacement );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-23 16:15:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wrapper for wc_doing_it_wrong.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @since 3.0.0
|
2016-11-23 16:15:00 +00:00
|
|
|
* @param string $function
|
|
|
|
* @param string $version
|
|
|
|
* @param string $replacement
|
|
|
|
*/
|
|
|
|
function wc_doing_it_wrong( $function, $message, $version ) {
|
2017-04-13 13:01:58 +00:00
|
|
|
$message .= ' Backtrace: ' . wp_debug_backtrace_summary();
|
|
|
|
|
2016-11-23 16:15:00 +00:00
|
|
|
if ( is_ajax() ) {
|
2017-01-05 18:54:10 +00:00
|
|
|
do_action( 'doing_it_wrong_run', $function, $message, $version );
|
2016-11-23 16:15:00 +00:00
|
|
|
error_log( "{$function} was called incorrectly. {$message}. This message was added in version {$version}." );
|
|
|
|
} else {
|
|
|
|
_doing_it_wrong( $function, $message, $version );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-11-11 15:31:00 +00:00
|
|
|
/**
|
2016-11-23 16:15:00 +00:00
|
|
|
* Wrapper for deprecated arguments so we can apply some extra logic.
|
2016-11-11 15:31:00 +00:00
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @since 3.0.0
|
2016-11-11 15:31:00 +00:00
|
|
|
* @param string $argument
|
|
|
|
* @param string $version
|
|
|
|
* @param string $replacement
|
|
|
|
*/
|
2016-11-23 16:15:00 +00:00
|
|
|
function wc_deprecated_argument( $argument, $version, $message = null ) {
|
|
|
|
if ( is_ajax() ) {
|
2017-01-27 00:30:25 +00:00
|
|
|
do_action( 'deprecated_argument_run', $argument, $message, $version );
|
2016-11-23 16:15:00 +00:00
|
|
|
error_log( "The {$argument} argument is deprecated since version {$version}. {$message}" );
|
|
|
|
} else {
|
2016-11-11 15:31:00 +00:00
|
|
|
_deprecated_argument( $argument, $version, $message );
|
|
|
|
}
|
2014-09-20 19:08:35 +00:00
|
|
|
}
|
2013-06-11 14:59:34 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-06-11 14:59:34 +00:00
|
|
|
function woocommerce_show_messages() {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_show_messages', '2.1', 'wc_print_notices' );
|
2013-11-13 04:34:55 +00:00
|
|
|
wc_print_notices();
|
2013-06-17 11:21:06 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-06-22 10:37:59 +00:00
|
|
|
function woocommerce_weekend_area_js() {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_weekend_area_js', '2.1' );
|
2013-06-22 10:37:59 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-06-24 16:47:28 +00:00
|
|
|
function woocommerce_tooltip_js() {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_tooltip_js', '2.1' );
|
2013-06-24 16:47:28 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-06-24 16:47:28 +00:00
|
|
|
function woocommerce_datepicker_js() {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_datepicker_js', '2.1' );
|
2013-06-24 16:47:28 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-07-24 20:24:32 +00:00
|
|
|
function woocommerce_admin_scripts() {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_admin_scripts', '2.1' );
|
2013-07-24 20:24:32 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-07-25 15:29:25 +00:00
|
|
|
function woocommerce_create_page( $slug, $option = '', $page_title = '', $page_content = '', $post_parent = 0 ) {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_create_page', '2.1', 'wc_create_page' );
|
2013-07-25 15:29:25 +00:00
|
|
|
return wc_create_page( $slug, $option, $page_title, $page_content, $post_parent );
|
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-02-14 18:55:30 +00:00
|
|
|
* @deprecated 2.1
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-08-09 16:11:15 +00:00
|
|
|
function woocommerce_readfile_chunked( $file, $retbytes = true ) {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_readfile_chunked', '2.1', 'WC_Download_Handler::readfile_chunked()' );
|
2014-10-24 16:06:30 +00:00
|
|
|
return WC_Download_Handler::readfile_chunked( $file );
|
2013-08-09 16:11:15 +00:00
|
|
|
}
|
|
|
|
|
2013-11-12 17:43:30 +00:00
|
|
|
/**
|
|
|
|
* Formal total costs - format to the number of decimal places for the base currency.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
* @param mixed $number
|
|
|
|
* @deprecated 2.1
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function woocommerce_format_total( $number ) {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '2.1', 'wc_format_decimal()' );
|
2015-01-23 11:50:32 +00:00
|
|
|
return wc_format_decimal( $number, wc_get_price_decimals(), false );
|
2013-11-12 17:43:30 +00:00
|
|
|
}
|
|
|
|
|
2013-08-09 16:11:15 +00:00
|
|
|
/**
|
|
|
|
* Get product name with extra details such as SKU price and attributes. Used within admin.
|
|
|
|
*
|
|
|
|
* @access public
|
2013-11-28 12:54:19 +00:00
|
|
|
* @param WC_Product $product
|
2013-08-09 16:11:15 +00:00
|
|
|
* @deprecated 2.1
|
2013-11-28 12:54:19 +00:00
|
|
|
* @return string
|
2013-08-09 16:11:15 +00:00
|
|
|
*/
|
|
|
|
function woocommerce_get_formatted_product_name( $product ) {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '2.1', 'WC_Product::get_formatted_name()' );
|
2013-08-09 16:11:15 +00:00
|
|
|
return $product->get_formatted_name();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Handle IPN requests for the legacy paypal gateway by calling gateways manually if needed.
|
|
|
|
*
|
|
|
|
* @access public
|
|
|
|
*/
|
|
|
|
function woocommerce_legacy_paypal_ipn() {
|
2016-09-07 22:32:24 +00:00
|
|
|
if ( ! empty( $_GET['paypalListener'] ) && 'paypal_standard_IPN' === $_GET['paypalListener'] ) {
|
2013-11-25 14:01:32 +00:00
|
|
|
WC()->payment_gateways();
|
2013-08-09 16:11:15 +00:00
|
|
|
do_action( 'woocommerce_api_wc_gateway_paypal' );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
add_action( 'init', 'woocommerce_legacy_paypal_ipn' );
|
|
|
|
|
2014-08-19 10:19:26 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-19 10:19:26 +00:00
|
|
|
*/
|
|
|
|
function get_product( $the_product = false, $args = array() ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_product' );
|
2014-08-19 10:19:26 +00:00
|
|
|
return wc_get_product( $the_product, $args );
|
|
|
|
}
|
|
|
|
|
2013-11-25 12:23:39 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:23:39 +00:00
|
|
|
function woocommerce_protected_product_add_to_cart( $passed, $product_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_protected_product_add_to_cart' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_protected_product_add_to_cart( $passed, $product_id );
|
2013-11-25 12:23:39 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:23:39 +00:00
|
|
|
function woocommerce_empty_cart() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_empty_cart' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_empty_cart();
|
2013-11-25 12:23:39 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:23:39 +00:00
|
|
|
function woocommerce_load_persistent_cart( $user_login, $user = 0 ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_load_persistent_cart' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_load_persistent_cart( $user_login, $user );
|
2013-11-25 12:23:39 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:23:39 +00:00
|
|
|
function woocommerce_add_to_cart_message( $product_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_add_to_cart_message' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_add_to_cart_message( $product_id );
|
2013-11-25 12:23:39 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:23:39 +00:00
|
|
|
function woocommerce_clear_cart_after_payment() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_clear_cart_after_payment' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_clear_cart_after_payment();
|
2013-11-25 12:23:39 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 15:17:18 +00:00
|
|
|
function woocommerce_cart_totals_subtotal_html() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cart_totals_subtotal_html' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_cart_totals_subtotal_html();
|
2013-11-25 15:17:18 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 15:17:18 +00:00
|
|
|
function woocommerce_cart_totals_shipping_html() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cart_totals_shipping_html' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_cart_totals_shipping_html();
|
2013-11-25 15:17:18 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 15:17:18 +00:00
|
|
|
function woocommerce_cart_totals_coupon_html( $coupon ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cart_totals_coupon_html' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_cart_totals_coupon_html( $coupon );
|
2013-11-25 15:17:18 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 15:17:18 +00:00
|
|
|
function woocommerce_cart_totals_order_total_html() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cart_totals_order_total_html' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_cart_totals_order_total_html();
|
2013-11-25 15:17:18 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 15:17:18 +00:00
|
|
|
function woocommerce_cart_totals_fee_html( $fee ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cart_totals_fee_html' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_cart_totals_fee_html( $fee );
|
2013-11-25 15:17:18 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 15:17:18 +00:00
|
|
|
function woocommerce_cart_totals_shipping_method_label( $method ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cart_totals_shipping_method_label' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_cart_totals_shipping_method_label( $method );
|
2013-11-25 15:17:18 +00:00
|
|
|
}
|
2013-06-22 10:37:59 +00:00
|
|
|
|
2013-11-25 12:45:04 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:45:04 +00:00
|
|
|
function woocommerce_get_template_part( $slug, $name = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_template_part' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_get_template_part( $slug, $name );
|
2013-11-25 12:45:04 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:45:04 +00:00
|
|
|
function woocommerce_get_template( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_template' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_get_template( $template_name, $args, $template_path, $default_path );
|
2013-11-25 12:45:04 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:45:04 +00:00
|
|
|
function woocommerce_locate_template( $template_name, $template_path = '', $default_path = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_locate_template' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_locate_template( $template_name, $template_path, $default_path );
|
2013-11-25 12:45:04 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:45:04 +00:00
|
|
|
function woocommerce_mail( $to, $subject, $message, $headers = "Content-Type: text/html\r\n", $attachments = "" ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_mail' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_mail( $to, $subject, $message, $headers, $attachments );
|
2013-11-25 12:45:04 +00:00
|
|
|
}
|
|
|
|
|
2013-11-25 12:52:53 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:52:53 +00:00
|
|
|
function woocommerce_disable_admin_bar( $show_admin_bar ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_disable_admin_bar' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_disable_admin_bar( $show_admin_bar );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:52:53 +00:00
|
|
|
function woocommerce_create_new_customer( $email, $username = '', $password = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_create_new_customer' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_create_new_customer( $email, $username, $password );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:52:53 +00:00
|
|
|
function woocommerce_set_customer_auth_cookie( $customer_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_set_customer_auth_cookie' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_set_customer_auth_cookie( $customer_id );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:52:53 +00:00
|
|
|
function woocommerce_update_new_customer_past_orders( $customer_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_update_new_customer_past_orders' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_update_new_customer_past_orders( $customer_id );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:51:14 +00:00
|
|
|
function woocommerce_paying_customer( $order_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_paying_customer' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_paying_customer( $order_id );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:52:53 +00:00
|
|
|
function woocommerce_customer_bought_product( $customer_email, $user_id, $product_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_customer_bought_product' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_customer_bought_product( $customer_email, $user_id, $product_id );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 12:52:53 +00:00
|
|
|
function woocommerce_customer_has_capability( $allcaps, $caps, $args ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_customer_has_capability' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_customer_has_capability( $allcaps, $caps, $args );
|
2013-11-25 12:52:53 +00:00
|
|
|
}
|
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_sanitize_taxonomy_name( $taxonomy ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_sanitize_taxonomy_name' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_sanitize_taxonomy_name( $taxonomy );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_get_filename_from_url( $file_url ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_filename_from_url' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_filename_from_url( $file_url );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_get_dimension( $dim, $to_unit ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_dimension' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_dimension( $dim, $to_unit );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_get_weight( $weight, $to_unit ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_weight' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_weight( $weight, $to_unit );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_trim_zeros( $price ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_trim_zeros' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_trim_zeros( $price );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_round_tax_total( $tax ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_round_tax_total' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_round_tax_total( $tax );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_format_decimal( $number, $dp = false, $trim_zeros = false ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_format_decimal' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_format_decimal( $number, $dp, $trim_zeros );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_clean( $var ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_clean' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_clean( $var );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_array_overlay( $a1, $a2 ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_array_overlay' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_array_overlay( $a1, $a2 );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_price( $price, $args = array() ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_price' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_price( $price, $args );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_let_to_num( $size ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_let_to_num' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_let_to_num( $size );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2013-11-27 18:20:31 +00:00
|
|
|
|
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_date_format() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_date_format' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_date_format();
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_time_format() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_time_format' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_time_format();
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_timezone_string() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_timezone_string' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_timezone_string();
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
if ( ! function_exists( 'woocommerce_rgb_from_hex' ) ) {
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_rgb_from_hex( $color ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_rgb_from_hex' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_rgb_from_hex( $color );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
if ( ! function_exists( 'woocommerce_hex_darker' ) ) {
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_hex_darker( $color, $factor = 30 ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_hex_darker' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_hex_darker( $color, $factor );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
if ( ! function_exists( 'woocommerce_hex_lighter' ) ) {
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_hex_lighter( $color, $factor = 30 ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_hex_lighter' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_hex_lighter( $color, $factor );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
if ( ! function_exists( 'woocommerce_light_or_dark' ) ) {
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_light_or_dark( $color, $dark = '#000000', $light = '#FFFFFF' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_light_or_dark' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_light_or_dark( $color, $dark, $light );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2013-11-25 13:34:21 +00:00
|
|
|
if ( ! function_exists( 'woocommerce_format_hex' ) ) {
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:34:21 +00:00
|
|
|
function woocommerce_format_hex( $hex ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_format_hex' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_format_hex( $hex );
|
2013-11-25 13:34:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-11-25 13:54:52 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_get_order_id_by_order_key( $order_key ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_order_id_by_order_key' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_order_id_by_order_key( $order_key );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_downloadable_file_permission( $download_id, $product_id, $order ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_downloadable_file_permission' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_downloadable_file_permission( $download_id, $product_id, $order );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_downloadable_product_permissions( $order_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_downloadable_product_permissions' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_downloadable_product_permissions( $order_id );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_add_order_item( $order_id, $item ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_add_order_item' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_add_order_item( $order_id, $item );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_delete_order_item( $item_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_delete_order_item' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_delete_order_item( $item_id );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_update_order_item_meta' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_value );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique = false ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_add_order_item_meta' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_add_order_item_meta( $item_id, $meta_key, $meta_value, $unique );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_delete_order_item_meta( $item_id, $meta_key, $meta_value = '', $delete_all = false ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_delete_order_item_meta' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_delete_order_item_meta( $item_id, $meta_key, $meta_value, $delete_all );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_get_order_item_meta( $item_id, $key, $single = true ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_order_item_meta' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_order_item_meta( $item_id, $key, $single );
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_cancel_unpaid_orders() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_cancel_unpaid_orders' );
|
2013-12-02 12:01:11 +00:00
|
|
|
wc_cancel_unpaid_orders();
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:54:52 +00:00
|
|
|
function woocommerce_processing_order_count() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_processing_order_count' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_processing_order_count();
|
2013-11-25 13:54:52 +00:00
|
|
|
}
|
|
|
|
|
2013-11-25 14:07:22 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_get_page_id( $page ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_page_id' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_page_id( $page );
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_get_endpoint_url( $endpoint, $value = '', $permalink = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_endpoint_url' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_get_endpoint_url( $endpoint, $value, $permalink );
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_lostpassword_url( $url ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_lostpassword_url' );
|
2015-06-25 18:17:01 +00:00
|
|
|
return wc_lostpassword_url( $url );
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_customer_edit_account_url() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_customer_edit_account_url' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_customer_edit_account_url();
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_nav_menu_items( $items, $args ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_nav_menu_items' );
|
2015-05-18 04:54:44 +00:00
|
|
|
return wc_nav_menu_items( $items );
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_nav_menu_item_classes( $menu_items, $args ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_nav_menu_item_classes' );
|
2015-05-18 04:54:44 +00:00
|
|
|
return wc_nav_menu_item_classes( $menu_items );
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 14:07:22 +00:00
|
|
|
function woocommerce_list_pages( $pages ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_list_pages' );
|
2013-11-28 11:16:00 +00:00
|
|
|
return wc_list_pages( $pages );
|
2013-11-25 14:07:22 +00:00
|
|
|
}
|
2013-06-22 10:37:59 +00:00
|
|
|
|
2013-06-17 11:21:06 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_product_dropdown_categories( $args = array(), $deprecated_hierarchical = 1, $deprecated_show_uncategorized = 1, $deprecated_orderby = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_product_dropdown_categories' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_product_dropdown_categories( $args, $deprecated_hierarchical, $deprecated_show_uncategorized, $deprecated_orderby );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2014-03-12 13:17:53 +00:00
|
|
|
function woocommerce_walk_category_dropdown_tree( $a1 = '', $a2 = '', $a3 = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_walk_category_dropdown_tree' );
|
2014-03-12 13:17:53 +00:00
|
|
|
return wc_walk_category_dropdown_tree( $a1, $a2, $a3 );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2017-02-14 18:55:30 +00:00
|
|
|
function woocommerce_taxonomy_metadata_wpdbfix() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0' );
|
2017-02-14 18:55:30 +00:00
|
|
|
}
|
|
|
|
|
2016-06-06 18:29:47 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2016-06-06 18:29:47 +00:00
|
|
|
*/
|
2017-02-14 18:55:30 +00:00
|
|
|
function wc_taxonomy_metadata_wpdbfix() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0' );
|
2017-02-14 18:55:30 +00:00
|
|
|
}
|
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_order_terms( $the_term, $next_id, $taxonomy, $index = 0, $terms = null ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_reorder_terms' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_reorder_terms( $the_term, $next_id, $taxonomy, $index, $terms );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_set_term_order( $term_id, $index, $taxonomy, $recursive = false ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_set_term_order' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_set_term_order( $term_id, $index, $taxonomy, $recursive );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_terms_clauses( $clauses, $taxonomies, $args ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_terms_clauses' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_terms_clauses( $clauses, $taxonomies, $args );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function _woocommerce_term_recount( $terms, $taxonomy, $callback, $terms_are_term_taxonomy_ids ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', '_wc_term_recount' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return _wc_term_recount( $terms, $taxonomy, $callback, $terms_are_term_taxonomy_ids );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_recount_after_stock_change( $product_id ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_recount_after_stock_change' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_recount_after_stock_change( $product_id );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_change_term_counts( $terms, $taxonomies, $args ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_change_term_counts' );
|
2015-05-18 04:54:44 +00:00
|
|
|
return wc_change_term_counts( $terms, $taxonomies );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_get_product_ids_on_sale() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_product_ids_on_sale' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_get_product_ids_on_sale();
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_get_featured_product_ids() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_featured_product_ids' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_get_featured_product_ids();
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_get_product_terms( $object_id, $taxonomy, $fields = 'all' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_product_terms' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_get_product_terms( $object_id, $taxonomy, array( 'fields' => $fields ) );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_product_post_type_link( $permalink, $post ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_product_post_type_link' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_product_post_type_link( $permalink, $post );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_placeholder_img_src() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_placeholder_img_src' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_placeholder_img_src();
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2014-02-09 05:09:31 +00:00
|
|
|
function woocommerce_placeholder_img( $size = 'shop_thumbnail' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_placeholder_img' );
|
2014-02-09 05:09:31 +00:00
|
|
|
return wc_placeholder_img( $size );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_get_formatted_variation( $variation = '', $flat = false ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_formatted_variation' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_get_formatted_variation( $variation, $flat );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_scheduled_sales() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_scheduled_sales' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_scheduled_sales();
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_get_attachment_image_attributes( $attr ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_get_attachment_image_attributes' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_get_attachment_image_attributes( $attr );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_prepare_attachment_for_js( $response ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_prepare_attachment_for_js' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_prepare_attachment_for_js( $response );
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-08-07 18:26:05 +00:00
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0
|
2014-08-07 18:26:05 +00:00
|
|
|
*/
|
2013-11-25 13:30:20 +00:00
|
|
|
function woocommerce_track_product_view() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( __FUNCTION__, '3.0', 'wc_track_product_view' );
|
2013-11-28 15:09:16 +00:00
|
|
|
return wc_track_product_view();
|
2013-11-25 13:30:20 +00:00
|
|
|
}
|
2017-02-14 18:55:30 +00:00
|
|
|
|
2014-09-22 18:30:07 +00:00
|
|
|
/**
|
|
|
|
* @since 2.3
|
2014-10-21 22:12:39 +00:00
|
|
|
* @deprecated has no replacement
|
2014-09-22 18:30:07 +00:00
|
|
|
*/
|
|
|
|
function woocommerce_compile_less_styles() {
|
2016-11-23 16:15:00 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_compile_less_styles', '2.3' );
|
2014-09-22 18:30:07 +00:00
|
|
|
}
|
2016-01-05 11:23:15 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* woocommerce_calc_shipping was an option used to determine if shipping was enabled prior to version 2.6.0. This has since been replaced with wc_shipping_enabled() function and
|
|
|
|
* the woocommerce_ship_to_countries setting.
|
|
|
|
* @since 2.6.0
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function woocommerce_calc_shipping_backwards_compatibility( $value ) {
|
|
|
|
if ( defined( 'WC_UPDATING' ) ) {
|
|
|
|
return $value;
|
|
|
|
}
|
|
|
|
return 'disabled' === get_option( 'woocommerce_ship_to_countries' ) ? 'no' : 'yes';
|
|
|
|
}
|
|
|
|
add_filter( 'pre_option_woocommerce_calc_shipping', 'woocommerce_calc_shipping_backwards_compatibility' );
|
2016-07-19 19:36:52 +00:00
|
|
|
|
|
|
|
/**
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0.0
|
2016-08-11 12:58:05 +00:00
|
|
|
* @see WC_Structured_Data class
|
2016-08-10 22:23:26 +00:00
|
|
|
*
|
2016-07-19 19:36:52 +00:00
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
function woocommerce_get_product_schema() {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_deprecated_function( 'woocommerce_get_product_schema', '3.0' );
|
2016-08-10 22:23:26 +00:00
|
|
|
|
2016-07-19 19:36:52 +00:00
|
|
|
global $product;
|
|
|
|
|
|
|
|
$schema = "Product";
|
|
|
|
|
|
|
|
// Downloadable product schema handling
|
|
|
|
if ( $product->is_downloadable() ) {
|
|
|
|
switch ( $product->download_type ) {
|
|
|
|
case 'application' :
|
|
|
|
$schema = "SoftwareApplication";
|
2016-08-11 09:17:14 +00:00
|
|
|
break;
|
2016-07-19 19:36:52 +00:00
|
|
|
case 'music' :
|
|
|
|
$schema = "MusicAlbum";
|
2016-08-11 09:17:14 +00:00
|
|
|
break;
|
2016-07-19 19:36:52 +00:00
|
|
|
default :
|
|
|
|
$schema = "Product";
|
2016-08-11 09:17:14 +00:00
|
|
|
break;
|
2016-07-19 19:36:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 'http://schema.org/' . $schema;
|
|
|
|
}
|
2016-11-09 17:32:40 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Save product price.
|
|
|
|
*
|
|
|
|
* This is a private function (internal use ONLY) used until a data manipulation api is built.
|
|
|
|
*
|
2017-03-15 16:36:53 +00:00
|
|
|
* @deprecated 3.0.0
|
2016-11-09 17:32:40 +00:00
|
|
|
* @param int $product_id
|
|
|
|
* @param float $regular_price
|
|
|
|
* @param float $sale_price
|
|
|
|
* @param string $date_from
|
|
|
|
* @param string $date_to
|
|
|
|
*/
|
|
|
|
function _wc_save_product_price( $product_id, $regular_price, $sale_price = '', $date_from = '', $date_to = '' ) {
|
2017-03-15 16:36:53 +00:00
|
|
|
wc_doing_it_wrong( '_wc_save_product_price()', 'This function is not for developer use and is deprecated.', '3.0' );
|
2016-11-09 17:32:40 +00:00
|
|
|
|
|
|
|
$product_id = absint( $product_id );
|
|
|
|
$regular_price = wc_format_decimal( $regular_price );
|
|
|
|
$sale_price = '' === $sale_price ? '' : wc_format_decimal( $sale_price );
|
|
|
|
$date_from = wc_clean( $date_from );
|
|
|
|
$date_to = wc_clean( $date_to );
|
|
|
|
|
|
|
|
update_post_meta( $product_id, '_regular_price', $regular_price );
|
|
|
|
update_post_meta( $product_id, '_sale_price', $sale_price );
|
|
|
|
|
|
|
|
// Save Dates
|
|
|
|
update_post_meta( $product_id, '_sale_price_dates_from', $date_from ? strtotime( $date_from ) : '' );
|
|
|
|
update_post_meta( $product_id, '_sale_price_dates_to', $date_to ? strtotime( $date_to ) : '' );
|
|
|
|
|
|
|
|
if ( $date_to && ! $date_from ) {
|
|
|
|
$date_from = strtotime( 'NOW', current_time( 'timestamp' ) );
|
|
|
|
update_post_meta( $product_id, '_sale_price_dates_from', $date_from );
|
|
|
|
}
|
|
|
|
|
|
|
|
// Update price if on sale
|
|
|
|
if ( '' !== $sale_price && '' === $date_to && '' === $date_from ) {
|
|
|
|
update_post_meta( $product_id, '_price', $sale_price );
|
|
|
|
} else {
|
|
|
|
update_post_meta( $product_id, '_price', $regular_price );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( '' !== $sale_price && $date_from && strtotime( $date_from ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
|
|
|
|
update_post_meta( $product_id, '_price', $sale_price );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $date_to && strtotime( $date_to ) < strtotime( 'NOW', current_time( 'timestamp' ) ) ) {
|
|
|
|
update_post_meta( $product_id, '_price', $regular_price );
|
|
|
|
update_post_meta( $product_id, '_sale_price_dates_from', '' );
|
|
|
|
update_post_meta( $product_id, '_sale_price_dates_to', '' );
|
|
|
|
}
|
|
|
|
}
|