Merge pull request #13608 from woocommerce/2.7-to-3.0
Version 2.7 to 3.0
This commit is contained in:
commit
71d0702523
|
@ -2,7 +2,7 @@
|
|||
# This file is distributed under the same license as the WooCommerce package.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: WooCommerce 2.7.0-RC1\n"
|
||||
"Project-Id-Version: WooCommerce 3.0.0-RC1\n"
|
||||
"Report-Msgid-Bugs-To: https://github.com/woocommerce/woocommerce/issues\n"
|
||||
"POT-Creation-Date: 2017-02-28 18:02:13+00:00\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -22511,4 +22511,4 @@ msgstr ""
|
|||
#: templates/product-searchform.php:27
|
||||
msgctxt "submit button"
|
||||
msgid "Search"
|
||||
msgstr ""
|
||||
msgstr ""
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @author WooThemes
|
||||
* @category i18n
|
||||
* @package WooCommerce/i18n
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
global $states;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @author hoshomoh
|
||||
* @category i18n
|
||||
* @package WooCommerce/i18n
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
global $states;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @author WooCommerce
|
||||
* @category i18n
|
||||
* @package WooCommerce/i18n
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
global $states;
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* ID for this object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var int
|
||||
*/
|
||||
protected $id = 0;
|
||||
|
@ -26,7 +26,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Core data for this object. Name value pairs (name + default value).
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array();
|
||||
|
@ -34,7 +34,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Core data changes for this object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $changes = array();
|
||||
|
@ -42,7 +42,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* This is false until the object is read from the DB.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var bool
|
||||
*/
|
||||
protected $object_read = false;
|
||||
|
@ -50,7 +50,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* This is the name of this object type.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var string
|
||||
*/
|
||||
protected $object_type = 'data';
|
||||
|
@ -60,7 +60,7 @@ abstract class WC_Data {
|
|||
* Used as a standard way for sub classes (like product types) to add
|
||||
* additional information to an inherited class.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array();
|
||||
|
@ -68,7 +68,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Set to _data on construct so we can track and reset data if needed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $default_data = array();
|
||||
|
@ -76,7 +76,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Contains a reference to the data store for this class.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var object
|
||||
*/
|
||||
protected $data_store;
|
||||
|
@ -85,7 +85,7 @@ abstract class WC_Data {
|
|||
* Stores meta in cache for future reads.
|
||||
* A group must be set to to enable caching.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var string
|
||||
*/
|
||||
protected $cache_group = '';
|
||||
|
@ -93,7 +93,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Stores additonal meta data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $meta_data = null;
|
||||
|
@ -113,7 +113,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Get the data store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return object
|
||||
*/
|
||||
public function get_data_store() {
|
||||
|
@ -189,7 +189,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Returns array of expected data keys for this object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_data_keys() {
|
||||
|
@ -199,7 +199,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Returns all "extra" data keys for an object (for sub objects like product types).
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_extra_data_keys() {
|
||||
|
@ -209,7 +209,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Filter null meta values from array.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return bool
|
||||
*/
|
||||
protected function filter_null_meta( $meta ) {
|
||||
|
@ -259,7 +259,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* See if meta data exists, since get_meta always returns a '' or array().
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $key
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -364,7 +364,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Read meta data if null.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected function maybe_read_meta_data() {
|
||||
if ( is_null( $this->meta_data ) ) {
|
||||
|
@ -455,7 +455,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Set ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $id
|
||||
*/
|
||||
public function set_id( $id ) {
|
||||
|
@ -465,7 +465,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Set all props to default values.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function set_defaults() {
|
||||
$this->data = $this->default_data;
|
||||
|
@ -476,7 +476,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Set object read property.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param boolean $read
|
||||
*/
|
||||
public function set_object_read( $read = true ) {
|
||||
|
@ -486,7 +486,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Get object read property.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return boolean
|
||||
*/
|
||||
public function get_object_read() {
|
||||
|
@ -497,7 +497,7 @@ abstract class WC_Data {
|
|||
* Set a collection of props in one go, collect any errors, and return the result.
|
||||
* Only sets using public methods.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $props Key value pairs to set. Key is the prop and should map to a setter function name.
|
||||
* @return WP_Error|bool
|
||||
*/
|
||||
|
@ -531,7 +531,7 @@ abstract class WC_Data {
|
|||
* This stores changes in a special array so we can track what needs saving
|
||||
* the the DB later.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to set.
|
||||
* @param mixed $value Value of the prop.
|
||||
*/
|
||||
|
@ -550,7 +550,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Return data changes only.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_changes() {
|
||||
|
@ -560,7 +560,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Merge changes with data and clear.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function apply_changes() {
|
||||
$this->data = array_replace_recursive( $this->data, $this->changes );
|
||||
|
@ -570,7 +570,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Prefix for action and filter hooks on data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
protected function get_hook_prefix() {
|
||||
|
@ -583,7 +583,7 @@ abstract class WC_Data {
|
|||
* Gets the value from either current pending changes, or the data itself.
|
||||
* Context controls what happens to the value before it's returned.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to get.
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
* @return mixed
|
||||
|
@ -605,7 +605,7 @@ abstract class WC_Data {
|
|||
/**
|
||||
* Sets a date prop whilst handling formatting and datatime objects.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to set.
|
||||
* @param string|integer $value Value of the prop.
|
||||
*/
|
||||
|
@ -630,7 +630,7 @@ abstract class WC_Data {
|
|||
* When invalid data is found, throw an exception unless reading from the DB.
|
||||
*
|
||||
* @throws WC_Data_Exception
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $code Error code.
|
||||
* @param string $message Error message.
|
||||
* @param int $http_status_code HTTP status code.
|
||||
|
|
|
@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*
|
||||
* Based on the WCS_Hook_Deprecator class by Prospress.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
abstract class WC_Deprecated_Hooks {
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ include_once( WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-order.php' );
|
|||
* WC_Order (regular orders) and WC_Order_Refund (refunds are negative orders).
|
||||
*
|
||||
* @class WC_Abstract_Order
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -20,12 +20,12 @@ include_once( WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-order.php' );
|
|||
abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
*
|
||||
* Notes: cart_tax = cart_tax is the new name for the legacy 'order_tax'
|
||||
* which is the tax for items only, not shipping.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
@ -48,7 +48,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Order items will be stored here, sometimes before they persist in the DB.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $items = array();
|
||||
|
@ -56,7 +56,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Order items that need deleting are stored here.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $items_to_delete = array();
|
||||
|
@ -122,7 +122,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Get all class data in array format.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
|
@ -159,7 +159,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Save data to the database.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int order ID
|
||||
*/
|
||||
public function save() {
|
||||
|
@ -213,7 +213,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Get parent order ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return integer
|
||||
*/
|
||||
|
@ -427,7 +427,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Get all valid statuses for this order
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array Internal status keys e.g. 'wc-processing'
|
||||
*/
|
||||
protected function get_valid_statuses() {
|
||||
|
@ -441,14 +441,14 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
|
|
||||
| Functions for setting order data. These should not update anything in the
|
||||
| database itself and should only change what is stored in the class
|
||||
| object. However, for backwards compatibility pre 2.7.0 some of these
|
||||
| object. However, for backwards compatibility pre 3.0.0 some of these
|
||||
| setters may handle both.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set parent order ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $value
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -462,7 +462,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Set order status.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $new_status Status to change the order to. No internal wc- prefix is required.
|
||||
* @return array details of change
|
||||
*/
|
||||
|
@ -612,7 +612,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
*/
|
||||
public function set_total( $value, $deprecated = '' ) {
|
||||
if ( $deprecated ) {
|
||||
wc_deprecated_argument( 'total_type', '2.7', 'Use dedicated total setter methods instead.' );
|
||||
wc_deprecated_argument( 'total_type', '3.0', 'Use dedicated total setter methods instead.' );
|
||||
return $this->legacy_set_total( $value, $deprecated );
|
||||
}
|
||||
$this->set_prop( 'total', wc_format_decimal( $value, wc_get_price_decimals() ) );
|
||||
|
@ -760,7 +760,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Get an order item object, based on it's type.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $item_id
|
||||
* @return WC_Order_Item
|
||||
*/
|
||||
|
@ -771,7 +771,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Get key for where a certain item type is stored in _items.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param $item object Order item (product, shipping, fee, coupon, tax)
|
||||
* @return string
|
||||
*/
|
||||
|
@ -811,7 +811,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
/**
|
||||
* Adds an order item to this order. The order item will not persist until save.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Order_Item Order item object (product, shipping, fee, coupon, tax)
|
||||
*/
|
||||
public function add_item( $item ) {
|
||||
|
@ -884,7 +884,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
$item->set_order_id( $this->get_id() );
|
||||
$item->save();
|
||||
$this->add_item( $item );
|
||||
wc_do_deprecated_action( 'woocommerce_order_add_product', array( $this->get_id(), $item->get_id(), $product, $qty, $args ), '2.7', 'woocommerce_new_order_item action instead' );
|
||||
wc_do_deprecated_action( 'woocommerce_order_add_product', array( $this->get_id(), $item->get_id(), $product, $qty, $args ), '3.0', 'woocommerce_new_order_item action instead' );
|
||||
return $item->get_id();
|
||||
}
|
||||
|
||||
|
@ -977,7 +977,7 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
|||
* Calculate taxes for all line items and shipping, and store the totals and tax rows.
|
||||
*
|
||||
* Will use the base country unless customer addresses are set.
|
||||
* @param $args array Added in 2.7.0 to pass things like location.
|
||||
* @param $args array Added in 3.0.0 to pass things like location.
|
||||
*/
|
||||
public function calculate_taxes( $args = array() ) {
|
||||
$tax_based_on = get_option( 'woocommerce_tax_based_on' );
|
||||
|
|
|
@ -14,7 +14,7 @@ include_once( WC_ABSPATH . 'includes/legacy/abstract-wc-legacy-product.php' );
|
|||
*
|
||||
* The WooCommerce product class handles individual product data.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Abstracts
|
||||
* @category Abstract Class
|
||||
* @author WooThemes
|
||||
|
@ -132,7 +132,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
*
|
||||
* The product_type property is deprecated but is used here for BW compat with child classes which may be defining product_type and not have a get_type method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_type() {
|
||||
|
@ -150,7 +150,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product name.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -161,7 +161,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product slug.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -172,7 +172,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product created date.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -183,7 +183,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product modified date.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -194,7 +194,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product status.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -205,7 +205,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* If the product is featured.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -216,7 +216,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get catalog visibility.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -227,7 +227,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product description.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -238,7 +238,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get product short description.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -289,7 +289,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get date on sale from.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -300,7 +300,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get date on sale to.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -311,7 +311,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get number total of sales.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -342,7 +342,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Return if product manage stock.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -364,7 +364,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Return the stock status.
|
||||
*
|
||||
* @param string $context
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_stock_status( $context = 'view' ) {
|
||||
|
@ -375,7 +375,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Get backorders.
|
||||
*
|
||||
* @param string $context
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string yes no or notify
|
||||
*/
|
||||
public function get_backorders( $context = 'view' ) {
|
||||
|
@ -386,7 +386,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* Return if should be sold individually.
|
||||
*
|
||||
* @param string $context
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return boolean
|
||||
*/
|
||||
public function get_sold_individually( $context = 'view' ) {
|
||||
|
@ -441,7 +441,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
*/
|
||||
public function get_dimensions( $formatted = true ) {
|
||||
if ( $formatted ) {
|
||||
wc_deprecated_argument( 'WC_Product::get_dimensions', '2.7', 'By default, get_dimensions has an argument set to true so that HTML is returned. This is to support the legacy version of the method. To get HTML dimensions, instead use wc_format_dimensions() function. Pass false to this method to return an array of dimensions. This will be the new default behavior in future versions.' );
|
||||
wc_deprecated_argument( 'WC_Product::get_dimensions', '3.0', 'By default, get_dimensions has an argument set to true so that HTML is returned. This is to support the legacy version of the method. To get HTML dimensions, instead use wc_format_dimensions() function. Pass false to this method to return an array of dimensions. This will be the new default behavior in future versions.' );
|
||||
return apply_filters( 'woocommerce_product_dimensions', wc_format_dimensions( $this->get_dimensions( false ) ), $this );
|
||||
}
|
||||
return array(
|
||||
|
@ -454,7 +454,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get upsel IDs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -465,7 +465,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get cross sell IDs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -476,7 +476,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get parent ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -487,7 +487,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Return if reviews is allowed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -498,7 +498,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get purchase note.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -519,7 +519,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get default attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -530,7 +530,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get menu order.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -541,7 +541,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get category ids.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -552,7 +552,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get tag ids.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -563,7 +563,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get virtual.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -584,7 +584,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get shipping class ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -595,7 +595,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get downloads.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -606,7 +606,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get download expiry.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -617,7 +617,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get downloadable.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -628,7 +628,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get download limit.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -639,7 +639,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get main image ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -687,7 +687,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product name.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $name Product name.
|
||||
*/
|
||||
public function set_name( $name ) {
|
||||
|
@ -697,7 +697,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product slug.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $slug Product slug.
|
||||
*/
|
||||
public function set_slug( $slug ) {
|
||||
|
@ -707,7 +707,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product created date.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if their is no date.
|
||||
*/
|
||||
public function set_date_created( $date = null ) {
|
||||
|
@ -717,7 +717,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product modified date.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if their is no date.
|
||||
*/
|
||||
public function set_date_modified( $date = null ) {
|
||||
|
@ -727,7 +727,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product status.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $status Product status.
|
||||
*/
|
||||
public function set_status( $status ) {
|
||||
|
@ -737,7 +737,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set if the product is featured.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool|string
|
||||
*/
|
||||
public function set_featured( $featured ) {
|
||||
|
@ -747,7 +747,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set catalog visibility.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
* @param string $visibility Options: 'hidden', 'visible', 'search' and 'catalog'.
|
||||
*/
|
||||
|
@ -762,7 +762,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product description.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $description Product description.
|
||||
*/
|
||||
public function set_description( $description ) {
|
||||
|
@ -772,7 +772,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set product short description.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $short_description Product short description.
|
||||
*/
|
||||
public function set_short_description( $short_description ) {
|
||||
|
@ -782,7 +782,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set SKU.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
* @param string $sku Product SKU.
|
||||
*/
|
||||
|
@ -808,7 +808,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product's regular price.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $price Regular price.
|
||||
*/
|
||||
public function set_regular_price( $price ) {
|
||||
|
@ -818,7 +818,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product's sale price.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $price sale price.
|
||||
*/
|
||||
public function set_sale_price( $price ) {
|
||||
|
@ -828,7 +828,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set date on sale from.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if their is no date.
|
||||
*/
|
||||
public function set_date_on_sale_from( $date = null ) {
|
||||
|
@ -838,7 +838,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set date on sale to.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if their is no date.
|
||||
*/
|
||||
public function set_date_on_sale_to( $date = null ) {
|
||||
|
@ -848,7 +848,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set number total of sales.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $total Total of sales.
|
||||
*/
|
||||
public function set_total_sales( $total ) {
|
||||
|
@ -858,7 +858,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the tax status.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
* @param string $status Tax status.
|
||||
*/
|
||||
|
@ -884,7 +884,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the tax class.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $class Tax class.
|
||||
*/
|
||||
public function set_tax_class( $class ) {
|
||||
|
@ -896,7 +896,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set if product manage stock.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool
|
||||
*/
|
||||
public function set_manage_stock( $manage_stock ) {
|
||||
|
@ -906,7 +906,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set number of items available for sale.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float|null $quantity Stock quantity.
|
||||
*/
|
||||
public function set_stock_quantity( $quantity ) {
|
||||
|
@ -925,7 +925,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set backorders.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $backorders Options: 'yes', 'no' or 'notify'.
|
||||
*/
|
||||
public function set_backorders( $backorders ) {
|
||||
|
@ -935,7 +935,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set if should be sold individually.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool
|
||||
*/
|
||||
public function set_sold_individually( $sold_individually ) {
|
||||
|
@ -945,7 +945,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product's weight.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float|string $weight Total weight.
|
||||
*/
|
||||
public function set_weight( $weight ) {
|
||||
|
@ -955,7 +955,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product length.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float|string $length Total length.
|
||||
*/
|
||||
public function set_length( $length ) {
|
||||
|
@ -965,7 +965,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product width.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float|string $width Total width.
|
||||
*/
|
||||
public function set_width( $width ) {
|
||||
|
@ -975,7 +975,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product height.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float|string $height Total height.
|
||||
*/
|
||||
public function set_height( $height ) {
|
||||
|
@ -985,7 +985,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set upsell IDs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $upsell_ids IDs from the up-sell products.
|
||||
*/
|
||||
public function set_upsell_ids( $upsell_ids ) {
|
||||
|
@ -995,7 +995,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set crosssell IDs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $cross_sell_ids IDs from the cross-sell products.
|
||||
*/
|
||||
public function set_cross_sell_ids( $cross_sell_ids ) {
|
||||
|
@ -1005,7 +1005,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set parent ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $parent_id Product parent ID.
|
||||
*/
|
||||
public function set_parent_id( $parent_id ) {
|
||||
|
@ -1015,7 +1015,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set if reviews is allowed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool $reviews_allowed Reviews allowed or not.
|
||||
*/
|
||||
public function set_reviews_allowed( $reviews_allowed ) {
|
||||
|
@ -1025,7 +1025,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set purchase note.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $purchase_note Purchase note.
|
||||
*/
|
||||
public function set_purchase_note( $purchase_note ) {
|
||||
|
@ -1044,7 +1044,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
* variation - If used for variations.
|
||||
* Indexed by unqiue key to allow clearing old ones after a set.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $raw_attributes Array of WC_Product_Attribute objects.
|
||||
*/
|
||||
public function set_attributes( $raw_attributes ) {
|
||||
|
@ -1062,7 +1062,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set default attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $default_attributes List of default attributes.
|
||||
*/
|
||||
public function set_default_attributes( $default_attributes ) {
|
||||
|
@ -1072,7 +1072,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set menu order.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $menu_order Menu order.
|
||||
*/
|
||||
public function set_menu_order( $menu_order ) {
|
||||
|
@ -1082,7 +1082,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product categories.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $term_ids List of terms IDs.
|
||||
*/
|
||||
public function set_category_ids( $term_ids ) {
|
||||
|
@ -1092,7 +1092,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set the product tags.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $term_ids List of terms IDs.
|
||||
*/
|
||||
public function set_tag_ids( $term_ids ) {
|
||||
|
@ -1102,7 +1102,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set if the product is virtual.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool|string
|
||||
*/
|
||||
public function set_virtual( $virtual ) {
|
||||
|
@ -1112,7 +1112,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set shipping class ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int
|
||||
*/
|
||||
public function set_shipping_class_id( $id ) {
|
||||
|
@ -1122,7 +1122,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set if the product is downloadable.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool|string
|
||||
*/
|
||||
public function set_downloadable( $downloadable ) {
|
||||
|
@ -1132,7 +1132,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set downloads.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param $downloads_array array of WC_Product_Download objects or arrays.
|
||||
*/
|
||||
public function set_downloads( $downloads_array ) {
|
||||
|
@ -1178,7 +1178,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set download limit.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $download_limit
|
||||
*/
|
||||
public function set_download_limit( $download_limit ) {
|
||||
|
@ -1188,7 +1188,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set download expiry.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $download_expiry
|
||||
*/
|
||||
public function set_download_expiry( $download_expiry ) {
|
||||
|
@ -1198,7 +1198,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set gallery attachment ids.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $image_ids
|
||||
*/
|
||||
public function set_gallery_image_ids( $image_ids ) {
|
||||
|
@ -1214,7 +1214,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Set main image ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $image_id
|
||||
*/
|
||||
public function set_image_id( $image_id = '' ) {
|
||||
|
@ -1253,7 +1253,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* Ensure properties are set correctly before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function validate_props() {
|
||||
// Before updating, ensure stock props are all aligned. Qty and backorders are not needed if not stock managed.
|
||||
|
@ -1274,7 +1274,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Save data (either create or update depending on if we are working on an existing product).
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function save() {
|
||||
$this->validate_props();
|
||||
|
@ -1552,7 +1552,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Does a child have dimensions?
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return bool
|
||||
*/
|
||||
public function child_has_dimensions() {
|
||||
|
@ -1562,7 +1562,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Does a child have a weight?
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return boolean
|
||||
*/
|
||||
public function child_has_weight() {
|
||||
|
@ -1615,7 +1615,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
|
||||
/**
|
||||
* If the stock level comes from another product ID, this should be modified.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int
|
||||
*/
|
||||
public function get_stock_managed_by_id() {
|
||||
|
@ -1657,7 +1657,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get min quantity which can be purchased at once.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int
|
||||
*/
|
||||
public function get_min_purchase_quantity() {
|
||||
|
@ -1667,7 +1667,7 @@ class WC_Product extends WC_Abstract_Legacy_Product {
|
|||
/**
|
||||
* Get max quantity which can be purchased at once.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int Quantity or -1 if unlimited.
|
||||
*/
|
||||
public function get_max_purchase_quantity() {
|
||||
|
|
|
@ -195,7 +195,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate a text value for a text based setting.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $value
|
||||
* @param array $setting
|
||||
* @return string
|
||||
|
@ -209,7 +209,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate select based settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $value
|
||||
* @param array $setting
|
||||
* @return string|WP_Error
|
||||
|
@ -225,7 +225,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate multiselect based settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $values
|
||||
* @param array $setting
|
||||
* @return string|WP_Error
|
||||
|
@ -252,7 +252,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate image_width based settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $value
|
||||
* @param array $setting
|
||||
* @return string|WP_Error
|
||||
|
@ -278,7 +278,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate radio based settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $value
|
||||
* @param array $setting
|
||||
* @return string|WP_Error
|
||||
|
@ -290,7 +290,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate checkbox based settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $value
|
||||
* @param array $setting
|
||||
* @return string|WP_Error
|
||||
|
@ -309,7 +309,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Validate textarea based settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $value
|
||||
* @param array $setting
|
||||
* @return string
|
||||
|
@ -329,7 +329,7 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
|
|||
/**
|
||||
* Add meta query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $args Query args.
|
||||
* @param array $meta_query Meta query.
|
||||
* @return array
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @author Automattic
|
||||
* @category API
|
||||
* @package WooCommerce/Abstracts
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -104,7 +104,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Prepares the object for the REST response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object Object data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_Error|WP_REST_Response Response object on success, or WP_Error object on failure.
|
||||
|
@ -116,7 +116,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Prepares one object for create or update operation.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @param bool $creating If is creating a new object.
|
||||
* @return WP_Error|WC_Data The prepared item, or WP_Error object on failure.
|
||||
|
@ -151,7 +151,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Save an object data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param bool $creating If is creating a new object.
|
||||
* @return WC_Data|WP_Error
|
||||
|
@ -250,7 +250,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Prepare objects query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -299,7 +299,7 @@ abstract class WC_REST_CRUD_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Get objects.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $query_args Query args.
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* Extended by shipping methods to handle shipping calculations etc.
|
||||
*
|
||||
* @class WC_Shipping_Method
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Abstracts
|
||||
* @category Abstract Class
|
||||
* @author WooThemes
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* @author WooCommerce
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! class_exists( 'WC_Admin_Duplicate_Product', false ) ) :
|
||||
|
@ -98,7 +98,7 @@ class WC_Admin_Duplicate_Product {
|
|||
|
||||
// Hook rename to match other woocommerce_product_* hooks, and to move away from depending on a response from the wp_posts table.
|
||||
do_action( 'woocommerce_product_duplicate', $duplicate, $product );
|
||||
wc_do_deprecated_action( 'woocommerce_duplicate_product', array( $duplicate->get_id(), $this->get_product_to_duplicate( $product_id ) ), '2.7', 'Use woocommerce_product_duplicate action instead.' );
|
||||
wc_do_deprecated_action( 'woocommerce_duplicate_product', array( $duplicate->get_id(), $this->get_product_to_duplicate( $product_id ) ), '3.0', 'Use woocommerce_product_duplicate action instead.' );
|
||||
|
||||
// Redirect to the edit screen for the new draft page
|
||||
wp_redirect( admin_url( 'post.php?action=edit&post=' . $duplicate->get_id() ) );
|
||||
|
@ -127,7 +127,7 @@ class WC_Admin_Duplicate_Product {
|
|||
$duplicate->delete_meta_data( $meta_key );
|
||||
}
|
||||
|
||||
// This action can be used to modify the object further before it is created - it will be passed by reference. @since 2.7
|
||||
// This action can be used to modify the object further before it is created - it will be passed by reference. @since 3.0
|
||||
do_action( 'woocommerce_product_duplicate_before_save', $duplicate, $product );
|
||||
|
||||
// Save parent product.
|
||||
|
@ -148,7 +148,7 @@ class WC_Admin_Duplicate_Product {
|
|||
$child_duplicate->delete_meta_data( $meta_key );
|
||||
}
|
||||
|
||||
// This action can be used to modify the object further before it is created - it will be passed by reference. @since 2.7
|
||||
// This action can be used to modify the object further before it is created - it will be passed by reference. @since 3.0
|
||||
do_action( 'woocommerce_product_duplicate_before_save', $child_duplicate, $child );
|
||||
|
||||
$child_duplicate->save();
|
||||
|
@ -161,7 +161,7 @@ class WC_Admin_Duplicate_Product {
|
|||
/**
|
||||
* Get a product from the database to duplicate.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param mixed $id
|
||||
* @return WP_Post|bool
|
||||
* @see duplicate_product
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* @author WooCommerce
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -833,7 +833,7 @@ class WC_Admin_Post_Types {
|
|||
* Offers a way to hook into save post without causing an infinite loop
|
||||
* when quick/bulk saving product info.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $post_id
|
||||
* @param object $post
|
||||
*/
|
||||
|
@ -1282,7 +1282,7 @@ class WC_Admin_Post_Types {
|
|||
/**
|
||||
* Handle shop order bulk actions.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $redirect_to URL to redirect to.
|
||||
* @param string $action Action name.
|
||||
* @param array $ids List of ids.
|
||||
|
|
|
@ -293,7 +293,7 @@ class WC_Admin_Status {
|
|||
/**
|
||||
* Clear DB log table.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
private static function flush_db_logs() {
|
||||
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-status-logs' ) ) {
|
||||
|
@ -309,7 +309,7 @@ class WC_Admin_Status {
|
|||
/**
|
||||
* Bulk DB log table actions.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
private static function log_table_bulk_actions() {
|
||||
if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-status-logs' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category Admin
|
||||
* @package WooCommerce/Admin/Meta Boxes
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -306,7 +306,7 @@ class WC_Meta_Box_Product_Data {
|
|||
}
|
||||
|
||||
/**
|
||||
* @since 2.7.0 to set props before save.
|
||||
* @since 3.0.0 to set props before save.
|
||||
*/
|
||||
do_action( 'woocommerce_admin_process_product_object', $product );
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ abstract class WC_Settings_Page {
|
|||
|
||||
/**
|
||||
* Get settings page ID.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_id() {
|
||||
|
@ -54,7 +54,7 @@ abstract class WC_Settings_Page {
|
|||
|
||||
/**
|
||||
* Get settings page label.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_label() {
|
||||
|
|
|
@ -140,7 +140,7 @@ class WC_REST_Authentication {
|
|||
/**
|
||||
* Parse the Authorization header into parameters.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param string $header Authorization header value (not including "Authorization: " prefix).
|
||||
*
|
||||
|
@ -173,7 +173,7 @@ class WC_REST_Authentication {
|
|||
* generate `PHP_AUTH_USER`/`PHP_AUTH_PASS` but not passed on. We use
|
||||
* `getallheaders` here to try and grab it out instead.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return string Authorization header if set.
|
||||
*/
|
||||
|
@ -198,7 +198,7 @@ class WC_REST_Authentication {
|
|||
/**
|
||||
* Get oAuth parameters from $_GET, $_POST or request header.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
|
|
|
@ -119,7 +119,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Legacy_Coupons_Controller {
|
|||
/**
|
||||
* Get object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $id Object ID.
|
||||
* @return WC_Data
|
||||
*/
|
||||
|
@ -192,7 +192,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Legacy_Coupons_Controller {
|
|||
/**
|
||||
* Prepare a single coupon output for response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object Object data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response
|
||||
|
@ -221,7 +221,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Legacy_Coupons_Controller {
|
|||
/**
|
||||
* Prepare objects query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -32,7 +32,7 @@ class WC_REST_Customers_Controller extends WC_REST_Customers_V1_Controller {
|
|||
/**
|
||||
* Get formatted item data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object WC_Data instance.
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -120,7 +120,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
/**
|
||||
* Get object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $id Object ID.
|
||||
* @return WC_Data
|
||||
*/
|
||||
|
@ -131,7 +131,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
/**
|
||||
* Get formatted item data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object WC_Data instance.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -173,7 +173,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
/**
|
||||
* Prepare a single order output for response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object Object data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response
|
||||
|
@ -240,7 +240,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
/**
|
||||
* Prepare objects query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -256,7 +256,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
/**
|
||||
* Prepares one object for create or update operation.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @param bool $creating If is creating a new object.
|
||||
* @return WP_Error|WC_Data The prepared item, or WP_Error object on failure.
|
||||
|
@ -306,7 +306,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
|
|||
/**
|
||||
* Save an object data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param bool $creating If is creating a new object.
|
||||
* @return WC_Data|WP_Error
|
||||
|
|
|
@ -126,7 +126,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
/**
|
||||
* Get object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $id Object ID.
|
||||
* @return WC_Data
|
||||
*/
|
||||
|
@ -187,7 +187,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
/**
|
||||
* Get formatted item data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object WC_Data instance.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -275,7 +275,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
/**
|
||||
* Prepare a single order output for response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object Object data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response
|
||||
|
@ -337,7 +337,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
/**
|
||||
* Prepare objects query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -474,7 +474,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
/**
|
||||
* Save an object data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @param bool $creating If is creating a new object.
|
||||
* @return WC_Data|WP_Error
|
||||
|
@ -733,7 +733,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_rest_set_order_item', $item, $posted );
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -75,7 +75,7 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Product_Reviews_V1_Cont
|
|||
/**
|
||||
* Bulk create, update and delete items.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array Of WP_Error or WP_REST_Response.
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -135,7 +135,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
/**
|
||||
* Get object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $id Object ID.
|
||||
* @return WC_Data
|
||||
*/
|
||||
|
@ -146,7 +146,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
/**
|
||||
* Prepare a single variation output for response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object Object data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response
|
||||
|
@ -222,7 +222,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
/**
|
||||
* Prepare objects query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -529,7 +529,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
|
|||
/**
|
||||
* Bulk create, update and delete items.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array Of WP_Error or WP_REST_Response.
|
||||
*/
|
||||
|
|
|
@ -127,7 +127,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
/**
|
||||
* Get object.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $id Object ID.
|
||||
* @return WC_Data
|
||||
*/
|
||||
|
@ -138,7 +138,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
/**
|
||||
* Prepare a single product output for response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data $object Object data.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response
|
||||
|
@ -178,7 +178,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
/**
|
||||
* Prepare objects query.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -1115,12 +1115,12 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
*
|
||||
* @param WC_Product $product Product instance.
|
||||
* @param array $downloads Downloads data.
|
||||
* @param int $deprecated Deprecated since 2.7.
|
||||
* @param int $deprecated Deprecated since 3.0.
|
||||
* @return WC_Product
|
||||
*/
|
||||
protected function save_downloadable_files( $product, $downloads, $deprecated = 0 ) {
|
||||
if ( $deprecated ) {
|
||||
wc_deprecated_argument( 'variation_id', '2.7', 'save_downloadable_files() not requires a variation_id anymore.' );
|
||||
wc_deprecated_argument( 'variation_id', '3.0', 'save_downloadable_files() not requires a variation_id anymore.' );
|
||||
}
|
||||
|
||||
$files = array();
|
||||
|
@ -1163,7 +1163,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
|
|||
/**
|
||||
* Save default attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param WC_Product $product Product instance.
|
||||
* @param WP_REST_Request $request Request data.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -37,7 +37,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Register routes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function register_routes() {
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base, array(
|
||||
|
@ -53,7 +53,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Get all settings groups items.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -109,7 +109,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Prepare a report sales object for serialization.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $item Group object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response $response Response data.
|
||||
|
@ -130,7 +130,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
* Filters out bad values from the groups array/filter so we
|
||||
* only return known values via the API.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $group
|
||||
* @return array
|
||||
*/
|
||||
|
@ -144,7 +144,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Callback for allowed keys for each group response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $key Key to check
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -155,7 +155,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Returns default settings for groups. null means the field is required.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
protected function group_defaults() {
|
||||
|
@ -171,7 +171,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Makes sure the current user has access to READ the settings APIs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|boolean
|
||||
*/
|
||||
|
@ -186,7 +186,7 @@ class WC_REST_Settings_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Get the groups schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_item_schema() {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -37,7 +37,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Register routes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function register_routes() {
|
||||
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<group>[\w-]+)', array(
|
||||
|
@ -100,7 +100,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Return a single setting.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -119,7 +119,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Return all settings in a group.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -146,7 +146,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Get all settings in a group.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $group_id Group ID.
|
||||
* @return array|WP_Error
|
||||
*/
|
||||
|
@ -189,7 +189,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Get setting data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $group_id Group ID.
|
||||
* @param string $setting_id Setting ID.
|
||||
* @return stdClass|WP_Error
|
||||
|
@ -223,7 +223,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Bulk create, update and delete items.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return array Of WP_Error or WP_REST_Response.
|
||||
*/
|
||||
|
@ -250,7 +250,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Update a single setting in a group.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request
|
||||
* @return WP_Error|WP_REST_Response
|
||||
*/
|
||||
|
@ -292,7 +292,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Prepare a single setting object for response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param object $item Setting object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_REST_Response $response Response data.
|
||||
|
@ -310,7 +310,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Prepare links for the request.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $setting_id Setting ID.
|
||||
* @param string $group_id Group ID.
|
||||
* @return array Links for the given setting.
|
||||
|
@ -332,7 +332,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Makes sure the current user has access to READ the settings APIs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|boolean
|
||||
*/
|
||||
|
@ -347,7 +347,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Makes sure the current user has access to WRITE the settings APIs.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full data about the request.
|
||||
* @return WP_Error|boolean
|
||||
*/
|
||||
|
@ -363,7 +363,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
* Filters out bad values from the settings array/filter so we
|
||||
* only return known values via the API.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $setting
|
||||
* @return array
|
||||
*/
|
||||
|
@ -388,7 +388,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
* For image_width, Crop can return "0" instead of false -- so we want
|
||||
* to make sure we return these consistently the same we accept them.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $setting
|
||||
* @return array
|
||||
*/
|
||||
|
@ -406,7 +406,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Callback for allowed keys for each setting response.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $key Key to check
|
||||
* @return boolean
|
||||
*/
|
||||
|
@ -428,7 +428,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Boolean for if a setting type is a valid supported setting type.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $type
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -451,7 +451,7 @@ class WC_REST_Settings_Options_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Get the settings schema, conforming to JSON Schema.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_item_schema() {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -25,7 +25,7 @@ class WC_REST_Legacy_Coupons_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Query args.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param array $args Query args
|
||||
* @param WP_REST_Request $request Request data.
|
||||
|
@ -43,7 +43,7 @@ class WC_REST_Legacy_Coupons_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Prepare a single coupon output for response.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
|
@ -94,7 +94,7 @@ class WC_REST_Legacy_Coupons_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Prepare a single coupon for create or update.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_Error|stdClass $data Post object.
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -32,7 +32,7 @@ class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Query args.
|
||||
*
|
||||
* @deprecated 2.7
|
||||
* @deprecated 3.0
|
||||
*
|
||||
* @param array $args
|
||||
* @param WP_REST_Request $request
|
||||
|
@ -91,7 +91,7 @@ class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Prepare a single order output for response.
|
||||
*
|
||||
* @deprecated 2.7
|
||||
* @deprecated 3.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
|
@ -156,7 +156,7 @@ class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Prepare a single order for create.
|
||||
*
|
||||
* @deprecated 2.7
|
||||
* @deprecated 3.0
|
||||
*
|
||||
* @param WP_REST_Request $request Request object.
|
||||
* @return WP_Error|WC_Order $data Object.
|
||||
|
@ -224,7 +224,7 @@ class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Create base WC Order object.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param array $data
|
||||
* @return WC_Order
|
||||
|
@ -236,7 +236,7 @@ class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Create order.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return int|WP_Error
|
||||
|
@ -270,7 +270,7 @@ class WC_REST_Legacy_Orders_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Update order.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return int|WP_Error
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -32,7 +32,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Query args.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param array $args Request args.
|
||||
* @param WP_REST_Request $request Request data.
|
||||
|
@ -152,7 +152,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Prepare a single product output for response.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param WP_Post $post Post object.
|
||||
* @param WP_REST_Request $request Request object.
|
||||
|
@ -197,7 +197,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Get product menu order.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param WC_Product $product Product instance.
|
||||
* @return int
|
||||
*/
|
||||
|
@ -208,7 +208,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Save product meta.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @param WP_REST_Request $request
|
||||
* @return bool
|
||||
|
@ -224,7 +224,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Set product meta.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @throws WC_REST_Exception REST API exceptions.
|
||||
* @param WC_Product $product Product instance.
|
||||
|
@ -514,7 +514,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Save variations.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @throws WC_REST_Exception REST API exceptions.
|
||||
* @param WC_Product $product Product instance.
|
||||
|
@ -700,7 +700,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Add post meta fields.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param WP_Post $post Post data.
|
||||
* @param WP_REST_Request $request Request data.
|
||||
|
@ -748,7 +748,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Delete post.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param int|WP_Post $id Post ID or WP_Post instance.
|
||||
*/
|
||||
|
@ -778,7 +778,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Get post types.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
|
@ -789,7 +789,7 @@ class WC_REST_Legacy_Products_Controller extends WC_REST_CRUD_Controller {
|
|||
/**
|
||||
* Save product images.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param int $product_id
|
||||
* @param array $images
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.1
|
||||
* @version 2.7
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.1
|
||||
* @version 2.7
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -815,7 +815,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
/**
|
||||
* Save default attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @param array $request
|
||||
* @return WC_Product
|
||||
|
@ -1495,12 +1495,12 @@ class WC_API_Products extends WC_API_Resource {
|
|||
* @since 2.2
|
||||
* @param WC_Product $product
|
||||
* @param array $downloads
|
||||
* @param int $deprecated Deprecated since 2.7.
|
||||
* @param int $deprecated Deprecated since 3.0.
|
||||
* @return WC_Product
|
||||
*/
|
||||
private function save_downloadable_files( $product, $downloads, $deprecated = 0 ) {
|
||||
if ( $deprecated ) {
|
||||
wc_deprecated_argument( 'variation_id', '2.7', 'save_downloadable_files() does not require a variation_id anymore.' );
|
||||
wc_deprecated_argument( 'variation_id', '3.0', 'save_downloadable_files() does not require a variation_id anymore.' );
|
||||
}
|
||||
|
||||
$files = array();
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.1
|
||||
* @version 2.7
|
||||
* @version 3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -1299,7 +1299,7 @@ class WC_API_Products extends WC_API_Resource {
|
|||
/**
|
||||
* Save default attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param WC_Product $product
|
||||
* @param WP_REST_Request $request
|
||||
|
@ -1994,12 +1994,12 @@ class WC_API_Products extends WC_API_Resource {
|
|||
* @since 2.2
|
||||
* @param WC_Product $product
|
||||
* @param array $downloads
|
||||
* @param int $deprecated Deprecated since 2.7.
|
||||
* @param int $deprecated Deprecated since 3.0.
|
||||
* @return WC_Product
|
||||
*/
|
||||
private function save_downloadable_files( $product, $downloads, $deprecated = 0 ) {
|
||||
if ( $deprecated ) {
|
||||
wc_deprecated_argument( 'variation_id', '2.7', 'save_downloadable_files() does not require a variation_id anymore.' );
|
||||
wc_deprecated_argument( 'variation_id', '3.0', 'save_downloadable_files() does not require a variation_id anymore.' );
|
||||
}
|
||||
|
||||
$files = array();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -379,7 +379,7 @@ class WC_REST_Coupons_V1_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Saves a coupon to the database.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return WP_Error|int
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -108,7 +108,7 @@ class WC_REST_Customer_Downloads_V1_Controller extends WC_REST_Controller {
|
|||
$data['access_expires'] = $data['access_expires'] ? wc_rest_prepare_date_response( $data['access_expires'] ) : 'never';
|
||||
$data['downloads_remaining'] = '' === $data['downloads_remaining'] ? 'unlimited' : $data['downloads_remaining'];
|
||||
|
||||
// Remove "product_name" since it's new in 2.7.
|
||||
// Remove "product_name" since it's new in 3.0.
|
||||
unset( $data['product_name'] );
|
||||
|
||||
$context = ! empty( $request['context'] ) ? $request['context'] : 'view';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -508,7 +508,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
|
|||
|
||||
/**
|
||||
* Create base WC Order object.
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param array $data
|
||||
* @return WC_Order
|
||||
*/
|
||||
|
@ -771,7 +771,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_rest_set_order_item', $item, $posted );
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -656,7 +656,7 @@ class WC_REST_Product_Attributes_V1_Controller extends WC_REST_Controller {
|
|||
/**
|
||||
* Schedule to flush rewrite rules.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected function flush_rewrite_rules() {
|
||||
wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
@ -443,7 +443,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Get product menu order.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param WC_Product $product Product instance.
|
||||
* @return int
|
||||
*/
|
||||
|
@ -823,7 +823,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Save product images.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param int $product_id
|
||||
* @param array $images
|
||||
* @throws WC_REST_Exception
|
||||
|
@ -947,12 +947,12 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
*
|
||||
* @param WC_Product $product Product instance.
|
||||
* @param array $downloads Downloads data.
|
||||
* @param int $deprecated Deprecated since 2.7.
|
||||
* @param int $deprecated Deprecated since 3.0.
|
||||
* @return WC_Product
|
||||
*/
|
||||
protected function save_downloadable_files( $product, $downloads, $deprecated = 0 ) {
|
||||
if ( $deprecated ) {
|
||||
wc_deprecated_argument( 'variation_id', '2.7', 'save_downloadable_files() not requires a variation_id anymore.' );
|
||||
wc_deprecated_argument( 'variation_id', '3.0', 'save_downloadable_files() not requires a variation_id anymore.' );
|
||||
}
|
||||
|
||||
$files = array();
|
||||
|
@ -995,7 +995,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Save default attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param WC_Product $product Product instance.
|
||||
* @param WP_REST_Request $request Request data.
|
||||
|
@ -1055,7 +1055,7 @@ class WC_REST_Products_V1_Controller extends WC_REST_Posts_Controller {
|
|||
/**
|
||||
* Save product meta.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @param WP_REST_Request $request
|
||||
* @return bool
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category API
|
||||
* @package WooCommerce/API
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -726,7 +726,7 @@ class WC_AJAX {
|
|||
$customer = new WC_Customer( $user_id );
|
||||
|
||||
if ( has_filter( 'woocommerce_found_customer_details' ) ) {
|
||||
wc_deprecated_function( 'The woocommerce_found_customer_details filter', '2.7', 'woocommerce_found_customer_details' );
|
||||
wc_deprecated_function( 'The woocommerce_found_customer_details filter', '3.0', 'woocommerce_found_customer_details' );
|
||||
}
|
||||
|
||||
$data = $customer->get_data();
|
||||
|
|
|
@ -275,7 +275,7 @@ class WC_API extends WC_Legacy_API {
|
|||
|
||||
/**
|
||||
* Register WC settings from WP-API to the REST API.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function register_wp_admin_settings() {
|
||||
$pages = WC_Admin_Settings::get_settings_pages();
|
||||
|
|
|
@ -538,7 +538,7 @@ class WC_Cart {
|
|||
public function get_item_data( $cart_item, $flat = false ) {
|
||||
$item_data = array();
|
||||
|
||||
// Variation values are shown only if they are not found in the title as of 2.7.
|
||||
// Variation values are shown only if they are not found in the title as of 3.0.
|
||||
// This is because variation titles display the attributes.
|
||||
if ( $cart_item['data']->is_type( 'variation' ) && is_array( $cart_item['variation'] ) ) {
|
||||
foreach ( $cart_item['variation'] as $name => $value ) {
|
||||
|
@ -1454,7 +1454,7 @@ class WC_Cart {
|
|||
/**
|
||||
* Filter items needing shipping callback.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $item
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -1466,7 +1466,7 @@ class WC_Cart {
|
|||
/**
|
||||
* Get only items that need shipping.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
protected function get_items_needing_shipping() {
|
||||
|
|
|
@ -158,7 +158,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Is registration required to checkout?
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return boolean
|
||||
*/
|
||||
public function is_registration_required() {
|
||||
|
@ -168,7 +168,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Is registration enabled on the checkout page?
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return boolean
|
||||
*/
|
||||
public function is_registration_enabled() {
|
||||
|
@ -319,7 +319,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust order before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_create_order', $order, $data );
|
||||
|
||||
|
@ -366,7 +366,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_create_order_line_item', $item, $cart_item_key, $values, $order );
|
||||
|
||||
|
@ -397,7 +397,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_create_order_fee_item', $item, $fee_key, $fee, $order );
|
||||
|
||||
|
@ -433,7 +433,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_create_order_shipping_item', $item, $package_key, $package, $order );
|
||||
|
||||
|
@ -463,7 +463,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_create_order_tax_item', $item, $tax_rate_id, $order );
|
||||
|
||||
|
@ -489,7 +489,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust item before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_create_order_coupon_item', $item, $code, $coupon, $order );
|
||||
|
||||
|
@ -501,7 +501,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* See if a fieldset should be skipped.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $fieldset_key
|
||||
* @param array $data
|
||||
*/
|
||||
|
@ -518,7 +518,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Get posted data from the checkout form.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array of data and errors.
|
||||
*/
|
||||
protected function get_posted_data() {
|
||||
|
@ -570,7 +570,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Validates the posted checkout data based on field properties.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $data An array of posted data.
|
||||
* @param WP_Error $errors
|
||||
*/
|
||||
|
@ -655,7 +655,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Validates that the checkout has enough info to proceed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $data An array of posted data.
|
||||
* @param WP_Error $errors
|
||||
*/
|
||||
|
@ -701,7 +701,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Update customer and session data from the posted checkout data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $data
|
||||
*/
|
||||
protected function update_session( $data ) {
|
||||
|
@ -748,7 +748,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Process an order that does require payment.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $order_id
|
||||
* @param string $payment_method
|
||||
*/
|
||||
|
@ -781,7 +781,7 @@ class WC_Checkout {
|
|||
/**
|
||||
* Process an order that doesn't require payment.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $order_id
|
||||
*/
|
||||
protected function process_order_without_payment( $order_id ) {
|
||||
|
@ -854,7 +854,7 @@ class WC_Checkout {
|
|||
|
||||
/**
|
||||
* Action hook to adjust customer before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
do_action( 'woocommerce_checkout_update_customer', $customer, $data );
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Enables WooCommerce, via the the command line.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce
|
||||
* @author WooCommerce
|
||||
*/
|
||||
|
|
|
@ -337,7 +337,7 @@ class WC_Comments {
|
|||
/**
|
||||
* Get product rating for a product. Please note this is not cached.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @return float
|
||||
*/
|
||||
|
@ -371,7 +371,7 @@ class WC_Comments {
|
|||
/**
|
||||
* Get product review count for a product (not replies). Please note this is not cached.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @return int
|
||||
*/
|
||||
|
@ -396,7 +396,7 @@ class WC_Comments {
|
|||
/**
|
||||
* Get product rating count for a product. Please note this is not cached.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @return array of integers
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* The WooCommerce coupons class gets coupon data from storage and checks coupon validity.
|
||||
*
|
||||
* @class WC_Coupon
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -20,7 +20,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Data array, with defaults.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
@ -112,7 +112,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
/**
|
||||
* Prefix for action and filter hooks on data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
protected function get_hook_prefix() {
|
||||
|
@ -130,7 +130,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon code.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -140,7 +140,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon description.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -150,7 +150,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get discount type.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -160,7 +160,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon code.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return float
|
||||
*/
|
||||
|
@ -170,7 +170,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon expiration date.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -180,7 +180,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get date_created
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -190,7 +190,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get date_modified
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|NULL object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -200,7 +200,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon usage count.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return integer
|
||||
*/
|
||||
|
@ -210,7 +210,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get the "indvidual use" checkbox status.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -220,7 +220,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get product IDs this coupon can apply to.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -230,7 +230,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get product IDs that this coupon should not apply to.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -240,7 +240,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon usage limit.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return integer
|
||||
*/
|
||||
|
@ -250,7 +250,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get coupon usage limit per customer (for a single customer)
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return integer
|
||||
*/
|
||||
|
@ -260,7 +260,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Usage limited to certain amount of items
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return integer
|
||||
*/
|
||||
|
@ -270,7 +270,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* If this coupon grants free shipping or not.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -280,7 +280,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get product categories this coupon can apply to.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -290,7 +290,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get product categories this coupon cannot not apply to.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -300,7 +300,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* If this coupon should exclude items on sale.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -310,7 +310,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get minium spend amount.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return float
|
||||
*/
|
||||
|
@ -319,7 +319,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
}
|
||||
/**
|
||||
* Get maximum spend amount.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return float
|
||||
*/
|
||||
|
@ -329,7 +329,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get emails to check customer usage restrictions.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -339,7 +339,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Get records of all users who have used the current coupon.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return array
|
||||
*/
|
||||
|
@ -420,7 +420,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set coupon code.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $code
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -430,7 +430,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set coupon description.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $description
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -440,7 +440,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set discount type.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $discount_type
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -456,7 +456,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set amount.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float $amount
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -466,7 +466,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set expiration date.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -476,7 +476,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set date_created
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -486,7 +486,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set date_modified
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if there is no date.
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -496,7 +496,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set how many times this coupon has been used.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $usage_count
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -506,7 +506,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set if this coupon can only be used once.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool $is_individual_use
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -516,7 +516,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the product IDs this coupon can be used with.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $product_ids
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -526,7 +526,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the product IDs this coupon cannot be used with.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $excluded_product_ids
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -536,7 +536,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the amount of times this coupon can be used.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $usage_limit
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -546,7 +546,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the amount of times this coupon can be used per user.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $usage_limit
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -556,7 +556,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set usage limit to x number of items.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $limit_usage_to_x_items
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -566,7 +566,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set if this coupon enables free shipping or not.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool $free_shipping
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -576,7 +576,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the product category IDs this coupon can be used with.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $product_categories
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -586,7 +586,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the product category IDs this coupon cannot be used with.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $excluded_product_categories
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -596,7 +596,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set if this coupon should excluded sale items or not.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool $exclude_sale_items
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -606,7 +606,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the minimum spend amount.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float $amount
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -616,7 +616,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set the maximum spend amount.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param float $amount
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -626,7 +626,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set email restrictions.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $emails
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -642,7 +642,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Set which users have used this coupon.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $used_by
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -658,7 +658,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
|
||||
/**
|
||||
* Developers can programically return coupons. This function will read those values into our WC_Coupon class.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $code Coupon code
|
||||
* @param array $coupon Array of coupon properties
|
||||
*/
|
||||
|
@ -668,20 +668,20 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
case 'excluded_product_ids' :
|
||||
case 'exclude_product_ids' :
|
||||
if ( ! is_array( $coupon[ $key ] ) ) {
|
||||
wc_doing_it_wrong( $key, $key . ' should be an array instead of a string.', '2.7' );
|
||||
wc_doing_it_wrong( $key, $key . ' should be an array instead of a string.', '3.0' );
|
||||
$coupon['excluded_product_ids'] = wc_string_to_array( $value );
|
||||
}
|
||||
break;
|
||||
case 'exclude_product_categories' :
|
||||
case 'excluded_product_categories' :
|
||||
if ( ! is_array( $coupon[ $key ] ) ) {
|
||||
wc_doing_it_wrong( $key, $key . ' should be an array instead of a string.', '2.7' );
|
||||
wc_doing_it_wrong( $key, $key . ' should be an array instead of a string.', '3.0' );
|
||||
$coupon['excluded_product_categories'] = wc_string_to_array( $value );
|
||||
}
|
||||
break;
|
||||
case 'product_ids' :
|
||||
if ( ! is_array( $coupon[ $key ] ) ) {
|
||||
wc_doing_it_wrong( $key, $key . ' should be an array instead of a string.', '2.7' );
|
||||
wc_doing_it_wrong( $key, $key . ' should be an array instead of a string.', '3.0' );
|
||||
$coupon[ $key ] = wc_string_to_array( $value );
|
||||
}
|
||||
break;
|
||||
|
@ -689,7 +689,7 @@ class WC_Coupon extends WC_Legacy_Coupon {
|
|||
case 'free_shipping' :
|
||||
case 'exclude_sale_items' :
|
||||
if ( ! is_bool( $coupon[ $key ] ) ) {
|
||||
wc_doing_it_wrong( $key, $key . ' should be true or false instead of yes or no.', '2.7' );
|
||||
wc_doing_it_wrong( $key, $key . ' should be true or false instead of yes or no.', '3.0' );
|
||||
$coupon[ $key ] = wc_string_to_bool( $value );
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -6,8 +6,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Class for customer download permissions.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@ class WC_Customer_Download extends WC_Data implements ArrayAccess {
|
|||
/**
|
||||
* Download Data array.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
@ -274,7 +274,7 @@ class WC_Customer_Download extends WC_Data implements ArrayAccess {
|
|||
|
||||
/**
|
||||
* Save data to the database.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int Item ID
|
||||
*/
|
||||
public function save() {
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* The WooCommerce customer class handles storage of the current customer's data, such as location.
|
||||
*
|
||||
* @class WC_Customer
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -120,7 +120,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Prefix for action and filter hooks on data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
protected function get_hook_prefix() {
|
||||
|
@ -131,7 +131,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
* Delete a customer and reassign posts..
|
||||
*
|
||||
* @param int $reassign Reassign posts and links to new User ID.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return bool
|
||||
*/
|
||||
public function delete_and_reassign( $reassign = null ) {
|
||||
|
@ -165,7 +165,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return this customer's avatar.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_avatar_url() {
|
||||
|
@ -247,7 +247,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Get if customer is VAT exempt?
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return bool
|
||||
*/
|
||||
public function get_is_vat_exempt() {
|
||||
|
@ -294,7 +294,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer's password.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $password
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -341,7 +341,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return the customer's username.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -352,7 +352,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return the customer's email.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -363,7 +363,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return customer's first name.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -374,7 +374,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return customer's last name.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -385,7 +385,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return customer's user role.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -396,7 +396,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return the date this customer was created.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|null object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -407,7 +407,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Return the date this customer was last updated.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return WC_DateTime|null object if the date is set or null if there is no date.
|
||||
*/
|
||||
|
@ -418,7 +418,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Gets a prop for a getter method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to get.
|
||||
* @param string $address billing or shipping.
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
|
@ -660,7 +660,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Is the user a paying customer?
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -677,7 +677,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer's username.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $username
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -688,7 +688,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer's email.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $value
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -702,7 +702,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer's first name.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $first_name
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -713,7 +713,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer's last name.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $last_name
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -724,7 +724,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer's user role(s).
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param mixed $role
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -740,7 +740,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set the date this customer was last updated.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if their is no date.
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -751,7 +751,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set the date this customer was last updated.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string|integer|null $date UTC timestamp, or ISO 8601 DateTime. If the DateTime string has no timezone or offset, WordPress site timezone will be assumed. Null if their is no date.
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
@ -762,7 +762,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer address to match shop base address.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
public function set_billing_address_to_base() {
|
||||
|
@ -773,7 +773,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set customer shipping address to base address.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
public function set_shipping_address_to_base() {
|
||||
|
@ -820,7 +820,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Sets a prop for a setter method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to set.
|
||||
* @param string $address Name of address to set. billing or shipping.
|
||||
* @param mixed $value Value of the prop.
|
||||
|
@ -1063,7 +1063,7 @@ class WC_Customer extends WC_Legacy_Customer {
|
|||
/**
|
||||
* Set if the user a paying customer.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool $is_paying_customer
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* @author WooThemes
|
||||
* @category Core
|
||||
* @package WooCommerce
|
||||
* @since 2.7
|
||||
* @since 3.0
|
||||
*/
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
|
|
|
@ -6,8 +6,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* WC Data Store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @version 2.7.0
|
||||
* @since 3.0.0
|
||||
* @version 3.0.0
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
@ -93,7 +93,7 @@ class WC_Data_Store {
|
|||
* Loads a data store.
|
||||
*
|
||||
* @param string $object_type Name of object.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public static function load( $object_type ) {
|
||||
return new WC_Data_Store( $object_type );
|
||||
|
@ -102,7 +102,7 @@ class WC_Data_Store {
|
|||
/**
|
||||
* Returns the class name of the current data store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function get_current_class_name() {
|
||||
|
@ -112,7 +112,7 @@ class WC_Data_Store {
|
|||
/**
|
||||
* Reads an object from the data store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data
|
||||
*/
|
||||
public function read( &$data ) {
|
||||
|
@ -122,7 +122,7 @@ class WC_Data_Store {
|
|||
/**
|
||||
* Create an object in the data store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data
|
||||
*/
|
||||
public function create( &$data ) {
|
||||
|
@ -132,7 +132,7 @@ class WC_Data_Store {
|
|||
/**
|
||||
* Update an object in the data store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data
|
||||
*/
|
||||
public function update( &$data ) {
|
||||
|
@ -142,7 +142,7 @@ class WC_Data_Store {
|
|||
/**
|
||||
* Delete an object from the data store.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Data
|
||||
* @param array $args Array of args to pass to the delete method.
|
||||
*/
|
||||
|
@ -155,7 +155,7 @@ class WC_Data_Store {
|
|||
* some helper methods for increasing or decreasing usage). This passes
|
||||
* through to the instance if that function exists.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param $method
|
||||
* @param $parameters
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* WC Wrapper for PHP DateTime.
|
||||
*
|
||||
* @class WC_DateTime
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -18,7 +18,7 @@ class WC_DateTime extends DateTime {
|
|||
/**
|
||||
* Output an ISO 8601 date string in local timezone.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
public function __toString() {
|
||||
|
@ -28,7 +28,7 @@ class WC_DateTime extends DateTime {
|
|||
/**
|
||||
* Missing in PHP 5.2.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int
|
||||
*/
|
||||
public function getTimestamp() {
|
||||
|
@ -38,7 +38,7 @@ class WC_DateTime extends DateTime {
|
|||
/**
|
||||
* Get the timestamp with the WordPress timezone offset added or subtracted.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int
|
||||
*/
|
||||
public function getOffsetTimestamp() {
|
||||
|
@ -48,7 +48,7 @@ class WC_DateTime extends DateTime {
|
|||
/**
|
||||
* Format a date based on the offset timestamp.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $format
|
||||
* @return string
|
||||
*/
|
||||
|
@ -59,7 +59,7 @@ class WC_DateTime extends DateTime {
|
|||
/**
|
||||
* Return a localised date based on offset timestamp. Wrapper for date_i18n function.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $format
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Handles deprecation notices and triggering of legacy action hooks.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class WC_Deprecated_Action_Hooks extends WC_Deprecated_Hooks {
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Handles deprecation notices and triggering of legacy filter hooks.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
class WC_Deprecated_Filter_Hooks extends WC_Deprecated_Hooks {
|
||||
|
||||
|
|
|
@ -524,7 +524,7 @@ class WC_Emails {
|
|||
/**
|
||||
* Adds Schema.org markup for order in JSON-LD format.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @see WC_Structured_Data::generate_order_data()
|
||||
*
|
||||
* @since 2.6.0
|
||||
|
@ -533,7 +533,7 @@ class WC_Emails {
|
|||
* @param bool $plain_text (default: false)
|
||||
*/
|
||||
public function order_schema_markup( $order, $sent_to_admin = false, $plain_text = false ) {
|
||||
wc_deprecated_function( 'WC_Emails::order_schema_markup', '2.7', 'WC_Structured_Data::generate_order_data' );
|
||||
wc_deprecated_function( 'WC_Emails::order_schema_markup', '3.0', 'WC_Structured_Data::generate_order_data' );
|
||||
|
||||
WC()->structured_data->generate_order_data( $order, $sent_to_admin, $plain_text );
|
||||
WC()->structured_data->output_structured_data();
|
||||
|
|
|
@ -49,7 +49,7 @@ class WC_Frontend_Scripts {
|
|||
/**
|
||||
* Add theme support for default WP themes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public static function add_default_theme_support() {
|
||||
if ( in_array( get_option( 'template' ), wc_get_core_supported_themes() ) ) {
|
||||
|
|
|
@ -228,7 +228,7 @@ class WC_Install {
|
|||
/**
|
||||
* Get list of DB update callbacks.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public static function get_db_update_callbacks() {
|
||||
|
|
|
@ -55,7 +55,7 @@ class WC_Logger implements WC_Logger_Interface {
|
|||
__( 'The provided handler <code>%s</code> does not implement WC_Log_Handler_Interface.', 'woocommerce' ),
|
||||
esc_html( is_object( $handler ) ? get_class( $handler ) : $handler )
|
||||
),
|
||||
'2.7'
|
||||
'3.0'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ class WC_Logger implements WC_Logger_Interface {
|
|||
public function add( $handle, $message, $level = WC_Log_Levels::NOTICE ) {
|
||||
$message = apply_filters( 'woocommerce_logger_add_message', $message, $handle );
|
||||
$this->log( $level, $message, array( 'source' => $handle, '_legacy' => true ) );
|
||||
wc_do_deprecated_action( 'woocommerce_log_add', array( $handle, $message ), '2.7', 'This action has been deprecated with no alternative.' );
|
||||
wc_do_deprecated_action( 'woocommerce_log_add', array( $handle, $message ), '3.0', 'This action has been deprecated with no alternative.' );
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -119,7 +119,7 @@ class WC_Logger implements WC_Logger_Interface {
|
|||
*/
|
||||
public function log( $level, $message, $context = array() ) {
|
||||
if ( ! WC_Log_Levels::is_valid_level( $level ) ) {
|
||||
wc_doing_it_wrong( __METHOD__, sprintf( __( 'WC_Logger::log was called with an invalid level "%s".', 'woocommerce' ), $level ), '2.7' );
|
||||
wc_doing_it_wrong( __METHOD__, sprintf( __( 'WC_Logger::log was called with an invalid level "%s".', 'woocommerce' ), $level ), '3.0' );
|
||||
}
|
||||
|
||||
if ( $this->should_handle( $level ) ) {
|
||||
|
@ -229,14 +229,14 @@ class WC_Logger implements WC_Logger_Interface {
|
|||
/**
|
||||
* Clear entries from chosen file.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
*
|
||||
* @param string $handle
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function clear( $handle ) {
|
||||
wc_deprecated_function( 'WC_Logger::clear', '2.7', 'WC_Log_Handler_File::clear' );
|
||||
wc_deprecated_function( 'WC_Logger::clear', '3.0', 'WC_Log_Handler_File::clear' );
|
||||
$handler = new WC_Log_Handler_File();
|
||||
return $handler->clear( $handle );
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* The WooCommerce order factory creating the right order objects.
|
||||
*
|
||||
* @class WC_Order_Factory
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooCommerce
|
||||
|
@ -123,7 +123,7 @@ class WC_Order_Factory {
|
|||
/**
|
||||
* Get the order ID depending on what was passed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param mixed $order
|
||||
* @return int|bool false on failure
|
||||
*/
|
||||
|
|
|
@ -6,16 +6,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Order Line Item (coupon).
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooCommerce
|
||||
*/
|
||||
class WC_Order_Item_Coupon extends WC_Order_Item {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* @since 2.7.0
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array(
|
||||
|
|
|
@ -9,16 +9,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* Fee is an amount of money charged for a particular piece of work
|
||||
* or for a particular right or service, and not supposed to be negative.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
class WC_Order_Item_Fee extends WC_Order_Item {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* @since 2.7.0
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array(
|
||||
|
|
|
@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*
|
||||
* A Simple class for managing order item meta so plugins add it in the correct format.
|
||||
*
|
||||
* @deprecated 2.7.0 wc_display_item_meta function is used instead.
|
||||
* @deprecated 3.0.0 wc_display_item_meta function is used instead.
|
||||
* @class order_item_meta
|
||||
* @version 2.4
|
||||
* @package WooCommerce/Classes
|
||||
|
|
|
@ -6,17 +6,17 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Order Line Item (product).
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
class WC_Order_Item_Product extends WC_Order_Item {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array(
|
||||
|
|
|
@ -6,16 +6,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Order Line Item (shipping).
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
class WC_Order_Item_Shipping extends WC_Order_Item {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* @since 2.7.0
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array(
|
||||
|
|
|
@ -6,16 +6,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Order Line Item (tax).
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
class WC_Order_Item_Tax extends WC_Order_Item {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* @since 2.7.0
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $extra_data = array(
|
||||
|
|
|
@ -9,16 +9,16 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* A class which represents an item within an order and handles CRUD.
|
||||
* Uses ArrayAccess to be BW compatible with WC_Orders::get_items().
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
class WC_Order_Item extends WC_Data implements ArrayAccess {
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* @since 2.7.0
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
|
|
@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* Order refund. Refunds are based on orders (essentially negative orders) and
|
||||
* contain much of the same data.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -89,7 +89,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
|
|||
/**
|
||||
* Get ID of user who did the refund.
|
||||
*
|
||||
* @since 2.7
|
||||
* @since 3.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -145,7 +145,7 @@ class WC_Order_Refund extends WC_Abstract_Order {
|
|||
* @return mixed
|
||||
*/
|
||||
public function __get( $key ) {
|
||||
wc_doing_it_wrong( $key, 'Refund properties should not be accessed directly.', '2.7' );
|
||||
wc_doing_it_wrong( $key, 'Refund properties should not be accessed directly.', '3.0' );
|
||||
/**
|
||||
* Maps legacy vars to new getters.
|
||||
*/
|
||||
|
@ -159,12 +159,12 @@ class WC_Order_Refund extends WC_Abstract_Order {
|
|||
|
||||
/**
|
||||
* Gets an refund from the database.
|
||||
* @deprecated 2.7
|
||||
* @deprecated 3.0
|
||||
* @param int $id (default: 0).
|
||||
* @return bool
|
||||
*/
|
||||
public function get_refund( $id = 0 ) {
|
||||
wc_deprecated_function( 'get_refund', '2.7', 'read' );
|
||||
wc_deprecated_function( 'get_refund', '3.0', 'read' );
|
||||
if ( ! $id ) {
|
||||
return false;
|
||||
}
|
||||
|
@ -177,21 +177,21 @@ class WC_Order_Refund extends WC_Abstract_Order {
|
|||
|
||||
/**
|
||||
* Get refund amount.
|
||||
* @deprecated 2.7
|
||||
* @deprecated 3.0
|
||||
* @return int|float
|
||||
*/
|
||||
public function get_refund_amount() {
|
||||
wc_deprecated_function( 'get_refund_amount', '2.7', 'get_amount' );
|
||||
wc_deprecated_function( 'get_refund_amount', '3.0', 'get_amount' );
|
||||
return $this->get_amount();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get refund reason.
|
||||
* @deprecated 2.7
|
||||
* @deprecated 3.0
|
||||
* @return int|float
|
||||
*/
|
||||
public function get_refund_reason() {
|
||||
wc_deprecated_function( 'get_refund_reason', '2.7', 'get_reason' );
|
||||
wc_deprecated_function( 'get_refund_reason', '3.0', 'get_reason' );
|
||||
return $this->get_reason();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,8 @@ class WC_Order extends WC_Abstract_Order {
|
|||
protected $status_transition = false;
|
||||
|
||||
/**
|
||||
* Order Data array. This is the core order data exposed in APIs since 2.7.0.
|
||||
* @since 2.7.0
|
||||
* Order Data array. This is the core order data exposed in APIs since 3.0.0.
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
@ -195,7 +195,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
/**
|
||||
* Save data to the database.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int order ID
|
||||
*/
|
||||
public function save() {
|
||||
|
@ -217,7 +217,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
|
||||
/**
|
||||
* Set order status.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $new_status Status to change the order to. No internal wc- prefix is required.
|
||||
* @param string $note (default: '') Optional note to add.
|
||||
* @param bool $manual_update is this a manual order status change?
|
||||
|
@ -252,7 +252,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
* This ensures the data exists even if a gateway does not use the
|
||||
* `payment_complete` method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function maybe_set_date_paid() {
|
||||
if ( ! $this->get_date_paid( 'edit' ) && $this->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id() ) ) ) {
|
||||
|
@ -265,7 +265,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
*
|
||||
* Sets the date completed variable when transitioning to completed status.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
protected function maybe_set_date_completed() {
|
||||
if ( $this->has_status( 'completed' ) ) {
|
||||
|
@ -328,7 +328,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
|
||||
/**
|
||||
* Get all class data in array format.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_data() {
|
||||
|
@ -382,7 +382,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
/**
|
||||
* Get order key.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -422,7 +422,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
/**
|
||||
* Gets a prop for a getter method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to get.
|
||||
* @param string $address billing or shipping.
|
||||
* @param string $context What the value is for. Valid values are view and edit.
|
||||
|
@ -730,7 +730,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
public function get_date_paid( $context = 'view' ) {
|
||||
$date_paid = $this->get_prop( 'date_paid', $context );
|
||||
|
||||
if ( 'view' === $context && ! $date_paid && version_compare( $this->get_version( 'edit' ), '2.7', '<' ) && $this->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id() ) ) ) {
|
||||
if ( 'view' === $context && ! $date_paid && version_compare( $this->get_version( 'edit' ), '3.0', '<' ) && $this->has_status( apply_filters( 'woocommerce_payment_complete_order_status', $this->needs_processing() ? 'processing' : 'completed', $this->get_id() ) ) ) {
|
||||
// In view context, return a date if missing.
|
||||
$date_paid = $this->get_date_created( 'edit' );
|
||||
}
|
||||
|
@ -818,7 +818,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
|
|
||||
| Functions for setting order data. These should not update anything in the
|
||||
| database itself and should only change what is stored in the class
|
||||
| object. However, for backwards compatibility pre 2.7.0 some of these
|
||||
| object. However, for backwards compatibility pre 3.0.0 some of these
|
||||
| setters may handle both.
|
||||
|
|
||||
*/
|
||||
|
@ -826,7 +826,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
/**
|
||||
* Sets a prop for a setter method.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $prop Name of prop to set.
|
||||
* @param string $address Name of address to set. billing or shipping.
|
||||
* @param mixed $value Value of the prop.
|
||||
|
@ -1082,7 +1082,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
/**
|
||||
* Set the payment method.
|
||||
*
|
||||
* @param string $payment_method Supports WC_Payment_Gateway for bw compatibility with < 2.7
|
||||
* @param string $payment_method Supports WC_Payment_Gateway for bw compatibility with < 3.0
|
||||
* @throws WC_Data_Exception
|
||||
*/
|
||||
public function set_payment_method( $payment_method = '' ) {
|
||||
|
@ -1294,7 +1294,7 @@ class WC_Order extends WC_Abstract_Order {
|
|||
* Orders which only contain virtual, downloadable items do not need admin
|
||||
* intervention.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return bool
|
||||
*/
|
||||
public function needs_processing() {
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* An API for storing and managing tokens for gateways and customers.
|
||||
*
|
||||
* @class WC_Payment_Tokens
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 2.6.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
|
|
|
@ -120,7 +120,7 @@ class WC_Post_Data {
|
|||
/**
|
||||
* Handle type changes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Product $product
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
|
|
|
@ -9,8 +9,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* Attributes can be global (taxonomy based) or local to the product itself.
|
||||
* Uses ArrayAccess to be BW compatible with previous ways of reading attributes.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
@ -19,7 +19,7 @@ class WC_Product_Attribute implements ArrayAccess {
|
|||
/**
|
||||
* Data array.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
|
|
@ -6,8 +6,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Represents a file which can be downloaded.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @author WooThemes
|
||||
*/
|
||||
|
@ -15,7 +15,7 @@ class WC_Product_Download implements ArrayAccess {
|
|||
|
||||
/**
|
||||
* Data array.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @var array
|
||||
*/
|
||||
protected $data = array(
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* External products cannot be bought; they link offsite. Extends simple products.
|
||||
*
|
||||
* @class WC_Product_External
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes/Products
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -75,7 +75,7 @@ class WC_Product_External extends WC_Product {
|
|||
/**
|
||||
* Set product URL.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $product_url Product URL.
|
||||
*/
|
||||
public function set_product_url( $product_url ) {
|
||||
|
@ -85,7 +85,7 @@ class WC_Product_External extends WC_Product {
|
|||
/**
|
||||
* Set button text.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $button_text Button text.
|
||||
*/
|
||||
public function set_button_text( $button_text ) {
|
||||
|
@ -95,7 +95,7 @@ class WC_Product_External extends WC_Product {
|
|||
/**
|
||||
* External products cannot be stock managed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool
|
||||
*/
|
||||
public function set_manage_stock( $manage_stock ) {
|
||||
|
@ -109,7 +109,7 @@ class WC_Product_External extends WC_Product {
|
|||
/**
|
||||
* External products cannot be stock managed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param bool
|
||||
*/
|
||||
public function set_stock_status( $stock_status = '' ) {
|
||||
|
@ -123,7 +123,7 @@ class WC_Product_External extends WC_Product {
|
|||
/**
|
||||
* xternal products cannot be backordered.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $backorders Options: 'yes', 'no' or 'notify'.
|
||||
*/
|
||||
public function set_backorders( $backorders ) {
|
||||
|
|
|
@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* The WooCommerce product factory creating the right product object.
|
||||
*
|
||||
* @class WC_Product_Factory
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -33,7 +33,7 @@ class WC_Product_Factory {
|
|||
|
||||
// Backwards compatibility.
|
||||
if ( ! empty( $deprecated ) ) {
|
||||
wc_deprecated_argument( 'args', '2.7', 'Passing args to the product factory is deprecated. If you need to force a type, construct the product class directly.' );
|
||||
wc_deprecated_argument( 'args', '3.0', 'Passing args to the product factory is deprecated. If you need to force a type, construct the product class directly.' );
|
||||
|
||||
if ( isset( $deprecated['product_type'] ) ) {
|
||||
$product_type = $this->get_classname_from_product_type( $deprecated['product_type'] );
|
||||
|
@ -60,7 +60,7 @@ class WC_Product_Factory {
|
|||
/**
|
||||
* Gets a product classname and allows filtering. Returns WC_Product_Simple if the class does not exist.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $product_id
|
||||
* @param string $product_type
|
||||
* @return string
|
||||
|
@ -78,7 +78,7 @@ class WC_Product_Factory {
|
|||
/**
|
||||
* Get the product type for a product.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param int $product_id
|
||||
* @return string|false
|
||||
*/
|
||||
|
@ -105,7 +105,7 @@ class WC_Product_Factory {
|
|||
/**
|
||||
* Get the product ID depending on what was passed.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param mixed $product
|
||||
* @return int|bool false on failure
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* Grouped products cannot be purchased - they are wrappers for other products.
|
||||
*
|
||||
* @class WC_Product_Grouped
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes/Products
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
|
|
@ -8,7 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*
|
||||
* The WooCommerce product class handles individual product data.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes/Products
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -177,7 +177,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
*/
|
||||
public function get_children( $visible_only = '' ) {
|
||||
if ( is_bool( $visible_only ) ) {
|
||||
wc_deprecated_argument( 'visible_only', '2.7', 'WC_Product_Variable::get_visible_children' );
|
||||
wc_deprecated_argument( 'visible_only', '3.0', 'WC_Product_Variable::get_visible_children' );
|
||||
return $visible_only ? $this->get_visible_children() : $this->get_children();
|
||||
}
|
||||
return apply_filters( 'woocommerce_get_children', $this->children, $this, false );
|
||||
|
@ -186,7 +186,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
/**
|
||||
* Return a products child ids - visible only.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array Children ids
|
||||
*/
|
||||
public function get_visible_children() {
|
||||
|
@ -300,7 +300,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
/**
|
||||
* Sets an array of variation attributes.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array
|
||||
*/
|
||||
public function set_variation_attributes( $variation_attributes ) {
|
||||
|
@ -310,7 +310,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
/**
|
||||
* Sets an array of children for the product.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array
|
||||
*/
|
||||
public function set_children( $children ) {
|
||||
|
@ -320,7 +320,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
/**
|
||||
* Sets an array of visible children only.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array
|
||||
*/
|
||||
public function set_visible_children( $visible_children ) {
|
||||
|
@ -335,7 +335,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
|
||||
/**
|
||||
* Ensure properties are set correctly before save.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function validate_props() {
|
||||
// Before updating, ensure stock props are all aligned. Qty and backorders are not needed if not stock managed.
|
||||
|
@ -360,7 +360,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
/**
|
||||
* Save data (either create or update depending on if we are working on an existing product).
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
*/
|
||||
public function save() {
|
||||
$this->validate_props();
|
||||
|
@ -497,7 +497,7 @@ class WC_Product_Variable extends WC_Product {
|
|||
$product->save();
|
||||
}
|
||||
|
||||
wc_do_deprecated_action( 'woocommerce_variable_product_sync', array( $product->get_id(), $product->get_visible_children() ), '2.7', 'woocommerce_variable_product_sync_data, woocommerce_new_product or woocommerce_update_product' );
|
||||
wc_do_deprecated_action( 'woocommerce_variable_product_sync', array( $product->get_id(), $product->get_visible_children() ), '3.0', 'woocommerce_variable_product_sync_data, woocommerce_new_product or woocommerce_update_product' );
|
||||
}
|
||||
return $product;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
* The WooCommerce product variation class handles product variation data.
|
||||
*
|
||||
* @class WC_Product_Variation
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooThemes
|
||||
|
@ -44,7 +44,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
/**
|
||||
* Prefix for action and filter hooks on data.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string
|
||||
*/
|
||||
protected function get_hook_prefix() {
|
||||
|
@ -61,7 +61,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
|
||||
/**
|
||||
* If the stock level comes from another product ID.
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return int
|
||||
*/
|
||||
public function get_stock_managed_by_id() {
|
||||
|
@ -223,7 +223,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
/**
|
||||
* Return if product manage stock.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return boolean|string true, false, or parent.
|
||||
*/
|
||||
|
@ -257,7 +257,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
* Get backorders.
|
||||
*
|
||||
* @param string $context
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return string yes no or notify
|
||||
*/
|
||||
public function get_backorders( $context = 'view' ) {
|
||||
|
@ -273,7 +273,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
/**
|
||||
* Get main image ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return string
|
||||
*/
|
||||
|
@ -290,7 +290,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
/**
|
||||
* Get shipping class ID.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param string $context
|
||||
* @return int
|
||||
*/
|
||||
|
@ -313,7 +313,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
/**
|
||||
* Set the parent data array for this variation.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array
|
||||
*/
|
||||
public function set_parent_data( $parent_data ) {
|
||||
|
@ -323,7 +323,7 @@ class WC_Product_Variation extends WC_Product_Simple {
|
|||
/**
|
||||
* Get the parent data array for this variation.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @return array
|
||||
*/
|
||||
public function get_parent_data() {
|
||||
|
|
|
@ -503,14 +503,14 @@ class WC_Query {
|
|||
/**
|
||||
* Order by rating post clauses.
|
||||
*
|
||||
* @deprecated 2.7.0
|
||||
* @deprecated 3.0.0
|
||||
* @param array $args
|
||||
* @return array
|
||||
*/
|
||||
public function order_by_rating_post_clauses( $args ) {
|
||||
global $wpdb;
|
||||
|
||||
wc_deprecated_function( 'order_by_rating_post_clauses', '2.7' );
|
||||
wc_deprecated_function( 'order_by_rating_post_clauses', '3.0' );
|
||||
|
||||
$args['fields'] .= ", AVG( $wpdb->commentmeta.meta_value ) as average_rating ";
|
||||
$args['where'] .= " AND ( $wpdb->commentmeta.meta_key = 'rating' OR $wpdb->commentmeta.meta_key IS null ) ";
|
||||
|
@ -622,7 +622,7 @@ class WC_Query {
|
|||
/**
|
||||
* Return a meta query for filtering by rating.
|
||||
*
|
||||
* @deprecated 2.7.0 Replaced with taxonomy.
|
||||
* @deprecated 3.0.0 Replaced with taxonomy.
|
||||
* @return array
|
||||
*/
|
||||
public function rating_filter_meta_query() {
|
||||
|
@ -632,7 +632,7 @@ class WC_Query {
|
|||
/**
|
||||
* Returns a meta query to handle product visibility.
|
||||
*
|
||||
* @deprecated 2.7.0 Replaced with taxonomy.
|
||||
* @deprecated 3.0.0 Replaced with taxonomy.
|
||||
* @param string $compare (default: 'IN')
|
||||
* @return array
|
||||
*/
|
||||
|
@ -643,7 +643,7 @@ class WC_Query {
|
|||
/**
|
||||
* Returns a meta query to handle product stock status.
|
||||
*
|
||||
* @deprecated 2.7.0 Replaced with taxonomy.
|
||||
* @deprecated 3.0.0 Replaced with taxonomy.
|
||||
* @param string $status (default: 'instock')
|
||||
* @return array
|
||||
*/
|
||||
|
|
|
@ -6,8 +6,8 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
/**
|
||||
* Take settings registered for WP-Admin and hooks them up to the REST API.
|
||||
*
|
||||
* @version 2.7.0
|
||||
* @since 2.7.0
|
||||
* @version 3.0.0
|
||||
* @since 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
*/
|
||||
|
@ -19,7 +19,7 @@ class WC_Register_WP_Admin_Settings {
|
|||
/**
|
||||
* Hooks into the settings API and starts registering our settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param WC_Email|WC_Settings_Page $object The object that contains the settings to register.
|
||||
* @param string $type Type of settings to register (email or page).
|
||||
*/
|
||||
|
@ -38,7 +38,7 @@ class WC_Register_WP_Admin_Settings {
|
|||
* Register's all of our different notification emails as sub groups
|
||||
* of email settings.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $groups Existing registered groups.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ class WC_Register_WP_Admin_Settings {
|
|||
/**
|
||||
* Registers all of the setting form fields for emails to each email type's group.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $settings Existing registered settings.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -74,7 +74,7 @@ class WC_Register_WP_Admin_Settings {
|
|||
/**
|
||||
* Registers a setting group, based on admin page ID & label as parent group.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $groups Array of previously registered groups.
|
||||
* @return array
|
||||
*/
|
||||
|
@ -89,7 +89,7 @@ class WC_Register_WP_Admin_Settings {
|
|||
/**
|
||||
* Registers settings to a specific group.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $settings Existing registered settings
|
||||
* @return array
|
||||
*/
|
||||
|
@ -125,7 +125,7 @@ class WC_Register_WP_Admin_Settings {
|
|||
/**
|
||||
* Register a setting into the format expected for the Settings REST API.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array $setting
|
||||
* @return array|bool
|
||||
*/
|
||||
|
|
|
@ -10,7 +10,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*
|
||||
* @class WC_Shipping_Zone
|
||||
* @since 2.6.0
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooCommerce
|
||||
|
@ -225,7 +225,7 @@ class WC_Shipping_Zone extends WC_Legacy_Shipping_Zone {
|
|||
/**
|
||||
* Set zone locations.
|
||||
*
|
||||
* @since 2.7.0
|
||||
* @since 3.0.0
|
||||
* @param array
|
||||
*/
|
||||
public function set_zone_locations( $locations ) {
|
||||
|
|
|
@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|||
*
|
||||
* @class WC_Shipping_Zones
|
||||
* @since 2.6.0
|
||||
* @version 2.7.0
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Classes
|
||||
* @category Class
|
||||
* @author WooCommerce
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue