Merge pull request #15070 from rasmusbe/phpdoc-missing-return-throws

Phpdoc: Add missing return and throws
This commit is contained in:
Mike Jolley 2017-05-23 18:50:58 +01:00 committed by GitHub
commit 00e5189a05
41 changed files with 218 additions and 85 deletions

View File

@ -630,6 +630,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
*
* @param string $value
* @param string $deprecated Function used to set different totals based on this.
*
* @return bool|void
* @throws WC_Data_Exception
*/
public function set_total( $value, $deprecated = '' ) {
@ -817,6 +819,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
* Remove item from the order.
*
* @param int $item_id
*
* @return false|void
*/
public function remove_item( $item_id ) {
$item = $this->get_item( $item_id );
@ -835,6 +839,8 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
*
* @since 3.0.0
* @param WC_Order_Item Order item object (product, shipping, fee, coupon, tax)
*
* * @return false|void
*/
public function add_item( $item ) {
if ( ! $items_key = $this->get_items_key( $item ) ) {

View File

@ -35,6 +35,8 @@ abstract class WC_REST_Controller extends WP_REST_Controller {
* The type of object is inferred from the passed schema.
*
* @param array $schema Schema array.
*
* @return array
*/
protected function add_additional_fields_schema( $schema ) {
if ( empty( $schema['title'] ) ) {

View File

@ -63,7 +63,10 @@ abstract class WC_Settings_API {
/**
* Set default required properties for each field.
* @param array
*
* @param array $field
*
* @return array
*/
protected function set_defaults( $field ) {
if ( ! isset( $field['default'] ) ) {

View File

@ -193,6 +193,7 @@ abstract class WC_Widget extends WP_Widget {
* Outputs the settings update form.
*
* @see WP_Widget->form
*
* @param array $instance
*/
public function form( $instance ) {

View File

@ -220,6 +220,8 @@ class WC_Report_Customer_List extends WP_List_Table {
* Order users by name.
*
* @param WP_User_Query $query
*
* @return WP_User_Query
*/
public function order_by_last_name( $query ) {
global $wpdb;

View File

@ -544,7 +544,9 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
* Gets the product ID from the SKU or posted ID.
*
* @param array $posted Request data
*
* @return int
* @throws WC_REST_Exception
*/
protected function get_product_id( $posted ) {
if ( ! empty( $posted['sku'] ) ) {
@ -606,6 +608,8 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
*
* @param array $posted Line item data.
* @param string $action 'create' to add line item or 'update' to update it.
*
* @return WC_Order_Item_Product
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_line_items( $posted, $action = 'create' ) {
@ -634,6 +638,8 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
*
* @param $posted $shipping Item data.
* @param string $action 'create' to add shipping or 'update' to update it.
*
* @return WC_Order_Item_Shipping
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_shipping_lines( $posted, $action ) {
@ -656,6 +662,8 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
*
* @param array $posted Item data.
* @param string $action 'create' to add fee or 'update' to update it.
*
* @return WC_Order_Item_Fee
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_fee_lines( $posted, $action ) {
@ -678,6 +686,8 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
*
* @param array $posted Item data.
* @param string $action 'create' to add coupon or 'update' to update it.
*
* @return WC_Order_Item_Coupon
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_coupon_lines( $posted, $action ) {

View File

@ -91,9 +91,12 @@ class WC_API_Coupons extends WC_API_Resource {
* Get the coupon for the given ID
*
* @since 2.1
*
* @param int $id the coupon ID
* @param string $fields fields to include in response
*
* @return array|WP_Error
* @throws WC_API_Exception
*/
public function get_coupon( $id, $fields = null ) {
$id = $this->validate_request( $id, 'shop_coupon', 'read' );

View File

@ -1613,8 +1613,11 @@ class WC_API_Products extends WC_API_Resource {
* Save product images
*
* @since 2.2
*
* @param WC_Product $product
* @param array $images
* @param array $images
*
* @return WC_Product
* @throws WC_API_Exception
*/
protected function save_product_images( $product, $images ) {

View File

@ -599,8 +599,11 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
/**
* Gets the product ID from the SKU or posted ID.
*
* @param array $posted Request data
*
* @return int
* @throws WC_REST_Exception
*/
protected function get_product_id( $posted ) {
if ( ! empty( $posted['sku'] ) ) {
@ -644,6 +647,8 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
*
* @param array $posted Line item data.
* @param string $action 'create' to add line item or 'update' to update it.
*
* @return WC_Order_Item_Product
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_line_items( $posted, $action = 'create' ) {
@ -671,6 +676,8 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
*
* @param $posted $shipping Item data.
* @param string $action 'create' to add shipping or 'update' to update it.
*
* @return WC_Order_Item_Shipping
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_shipping_lines( $posted, $action ) {
@ -692,6 +699,8 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
*
* @param array $posted Item data.
* @param string $action 'create' to add fee or 'update' to update it.
*
* @return WC_Order_Item_Fee
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_fee_lines( $posted, $action ) {
@ -713,6 +722,8 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
*
* @param array $posted Item data.
* @param string $action 'create' to add coupon or 'update' to update it.
*
* @return WC_Order_Item_Coupon
* @throws WC_REST_Exception Invalid data, server error.
*/
protected function prepare_coupon_lines( $posted, $action ) {

View File

@ -509,8 +509,11 @@ class WC_Checkout {
* See if a fieldset should be skipped.
*
* @since 3.0.0
*
* @param string $fieldset_key
* @param array $data
*
* @return bool
*/
protected function maybe_skip_fieldset( $fieldset_key, $data ) {
if ( 'shipping' === $fieldset_key && ( ! $data['ship_to_different_address'] || ! WC()->cart->needs_shipping_address() ) ) {

View File

@ -65,6 +65,8 @@ class WC_Data_Store {
* store we want to work with.
*
* @param string $object_type Name of object.
*
* @throws Exception
*/
public function __construct( $object_type ) {
$this->object_type = $object_type;
@ -117,7 +119,9 @@ class WC_Data_Store {
* Loads a data store.
*
* @param string $object_type Name of object.
*
* @since 3.0.0
* @return WC_Data_Store
*/
public static function load( $object_type ) {
return new WC_Data_Store( $object_type );
@ -180,8 +184,11 @@ class WC_Data_Store {
* through to the instance if that function exists.
*
* @since 3.0.0
*
* @param $method
* @param $parameters
*
* @return mixed
*/
public function __call( $method, $parameters ) {
if ( is_callable( array( $this->instance, $method ) ) ) {

View File

@ -51,7 +51,10 @@ class WC_DateTime extends DateTime {
/**
* Set timezone.
*
* @param DateTimeZone $timezone
*
* @return static
*/
public function setTimezone( $timezone ) {
$this->utc_offset = 0;

View File

@ -92,7 +92,10 @@ class WC_Frontend_Scripts {
/**
* Return protocol relative asset URL.
*
* @param string $path
*
* @return string
*/
private static function get_asset_url( $path ) {
return str_replace( array( 'http:', 'https:' ), '', plugins_url( $path, WC_PLUGIN_FILE ) );

View File

@ -218,10 +218,13 @@ class WC_Order extends WC_Abstract_Order {
/**
* Set order status.
* @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?
* @param array details of change
*
* @return array
*/
public function set_status( $new_status, $note = '', $manual_update = false ) {
$result = parent::set_status( $new_status );

View File

@ -160,6 +160,8 @@ class WC_Shipping {
* Register a shipping method.
*
* @param object|string $method Either the name of the method's class, or an instance of the method's class.
*
* @return bool|void
*/
public function register_shipping_method( $method ) {
if ( ! is_object( $method ) ) {

View File

@ -227,7 +227,10 @@ class WC_CLI_REST_Command {
* Do a REST Request
*
* @param string $method
* @param string $route
* @param array $assoc_args
*
* @return array
*/
private function do_request( $method, $route, $assoc_args ) {
if ( ! defined( 'REST_REQUEST' ) ) {
@ -443,6 +446,8 @@ EOT;
* This function decodes the json (if present) and tries to get it's value.
*
* @param array $arr
*
* @return array
*/
protected function decode_json( $arr ) {
foreach ( $arr as $key => $value ) {

View File

@ -77,7 +77,10 @@ abstract class Abstract_WC_Order_Data_Store_CPT extends WC_Data_Store_WP impleme
/**
* Method to read an order from the database.
* @param WC_Order
*
* @param WC_Data $order
*
* @throws Exception
*/
public function read( &$order ) {
$order->set_defaults();

View File

@ -98,7 +98,10 @@ abstract class Abstract_WC_Order_Item_Type_Data_Store extends WC_Data_Store_WP i
* Read a order item from the database.
*
* @since 3.0.0
*
* @param WC_Order_Item $item
*
* @throws Exception
*/
public function read( &$item ) {
global $wpdb;

View File

@ -81,7 +81,10 @@ class WC_Coupon_Data_Store_CPT extends WC_Data_Store_WP implements WC_Coupon_Dat
* Method to read a coupon.
*
* @since 3.0.0
* @param WC_Coupon
*
* @param WC_Data $coupon
*
* @throws Exception
*/
public function read( &$coupon ) {
$coupon->set_defaults();
@ -165,8 +168,9 @@ class WC_Coupon_Data_Store_CPT extends WC_Data_Store_WP implements WC_Coupon_Dat
* Deletes a coupon from the database.
*
* @since 3.0.0
* @param WC_Coupon
* @param array $args Array of args to pass to the delete method.
*
* @param WC_Coupon $coupon
* @param array $args Array of args to pass to the delete method.
*/
public function delete( &$coupon, $args = array() ) {
$args = wp_parse_args( $args, array(

View File

@ -142,6 +142,7 @@ class WC_Customer_Data_Store_Session extends WC_Data_Store_WP implements WC_Cust
* Deletes a customer from the database.
*
* @since 3.0.0
*
* @param WC_Customer
* @param array $args Array of args to pass to the delete method.
*/

View File

@ -91,7 +91,10 @@ class WC_Customer_Data_Store extends WC_Data_Store_WP implements WC_Customer_Dat
* Method to create a new customer in the database.
*
* @since 3.0.0
* @param WC_Customer
*
* @param WC_Data $customer
*
* @throws WC_Data_Exception
*/
public function create( &$customer ) {
$id = wc_create_new_customer( $customer->get_email(), $customer->get_username(), $customer->get_password() );

View File

@ -68,7 +68,9 @@ class WC_Customer_Download_Data_Store implements WC_Customer_Download_Data_Store
/**
* Method to read a download permission from the database.
*
* @param WC_Customer_Download
* @param $download
*
* @throws Exception
*/
public function read( &$download ) {
global $wpdb;

View File

@ -27,7 +27,10 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
* Create a new payment token in the database.
*
* @since 3.0.0
*
* @param WC_Payment_Token $token
*
* @throws Exception
*/
public function create( &$token ) {
if ( false === $token->validate() ) {
@ -68,7 +71,10 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
* Update a payment token.
*
* @since 3.0.0
*
* @param WC_Payment_Token $token
*
* @throws Exception
*/
public function update( &$token ) {
if ( false === $token->validate() ) {
@ -129,7 +135,10 @@ class WC_Payment_Token_Data_Store extends WC_Data_Store_WP implements WC_Payment
* Read a token from the database.
*
* @since 3.0.0
*
* @param WC_Payment_Token $token
*
* @throws Exception
*/
public function read( &$token ) {
global $wpdb;

View File

@ -124,7 +124,10 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
/**
* Method to read a product from the database.
* @param WC_Product
*
* @param WC_Data $product
*
* @throws Exception
*/
public function read( &$product ) {
$product->set_defaults();

View File

@ -32,7 +32,10 @@ class WC_Product_Variation_Data_Store_CPT extends WC_Product_Data_Store_CPT impl
* Reads a product from the database and sets its data to the class.
*
* @since 3.0.0
* @param WC_Product
*
* @param WC_Data $product
*
* @throws Exception
*/
public function read( &$product ) {
$product->set_defaults();

View File

@ -57,7 +57,10 @@ class WC_Shipping_Zone_Data_Store extends WC_Data_Store_WP implements WC_Shippin
* Method to read a shipping zone from the database.
*
* @since 3.0.0
* @param WC_Shipping_Zone
*
* @param WC_Data $zone
*
* @throws Exception
*/
public function read( &$zone ) {
global $wpdb;
@ -266,7 +269,10 @@ class WC_Shipping_Zone_Data_Store extends WC_Data_Store_WP implements WC_Shippin
* This function clears old locations, then re-inserts new if any changes are found.
*
* @since 3.0.0
*
* @param WC_Shipping_Zone
*
* @return bool|void
*/
private function save_locations( &$zone ) {
$changed_props = array_keys( $zone->get_changes() );

View File

@ -341,9 +341,11 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway_CC {
/**
* Actually saves a customer token to the database.
*
* @param WC_Payment_Token $customer_token Payment Token
* @param string $cart_token CC Token
* @param array $customer_info 'email', 'name'
* @param WC_Payment_Token $customer_token Payment Token
* @param string $cart_token CC Token
* @param array $customer_info 'email', 'name'
*
* @return null|WC_Payment_Token|WC_Payment_Token_CC
*/
public function save_token( $customer_token, $cart_token, $customer_info ) {
if ( ! is_null( $customer_token ) ) {
@ -568,6 +570,8 @@ class WC_Gateway_Simplify_Commerce extends WC_Payment_Gateway_CC {
* Process the payment.
*
* @param int $order_id
*
* @return array|void
*/
public function process_payment( $order_id ) {
$order = wc_get_order( $order_id );

View File

@ -71,13 +71,13 @@ class Simplify_Authorization extends Simplify_Object {
}
/**
* Deletes an Simplify_Authorization object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Authorization object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteAuthorization($authentication = null) {
$args = func_get_args();

View File

@ -60,13 +60,13 @@ class Simplify_Coupon extends Simplify_Object {
}
/**
* Deletes an Simplify_Coupon object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Coupon object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteCoupon($authentication = null) {
$args = func_get_args();

View File

@ -79,13 +79,13 @@ class Simplify_Customer extends Simplify_Object {
}
/**
* Deletes an Simplify_Customer object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Customer object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteCustomer($authentication = null) {
$args = func_get_args();

View File

@ -95,13 +95,13 @@ class Simplify_Invoice extends Simplify_Object {
}
/**
* Deletes an Simplify_Invoice object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Invoice object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteInvoice($authentication = null) {
$args = func_get_args();

View File

@ -58,13 +58,13 @@ class Simplify_InvoiceItem extends Simplify_Object {
}
/**
* Deletes an Simplify_InvoiceItem object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_InvoiceItem object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteInvoiceItem($authentication = null) {
$args = func_get_args();

View File

@ -61,13 +61,13 @@ class Simplify_Plan extends Simplify_Object {
}
/**
* Deletes an Simplify_Plan object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Plan object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deletePlan($authentication = null) {
$args = func_get_args();

View File

@ -63,13 +63,13 @@ class Simplify_Subscription extends Simplify_Object {
}
/**
* Deletes an Simplify_Subscription object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Subscription object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteSubscription($authentication = null) {
$args = func_get_args();

View File

@ -53,13 +53,13 @@ class Simplify_Tax extends Simplify_Object {
}
/**
* Deletes an Simplify_Tax object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Tax object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteTax($authentication = null) {
$args = func_get_args();

View File

@ -51,13 +51,13 @@ class Simplify_TransactionReview extends Simplify_Object {
}
/**
* Deletes an Simplify_TransactionReview object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_TransactionReview object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteTransactionReview($authentication = null) {
$args = func_get_args();

View File

@ -52,13 +52,13 @@ class Simplify_Webhook extends Simplify_Object {
}
/**
* Deletes an Simplify_Webhook object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*/
/**
* Deletes an Simplify_Webhook object.
*
* @param $authentication - information used for the API call. If no value is passed the global keys Simplify::public_key and Simplify::private_key are used. <i>For backwards compatibility the public and private keys may be passed instead of the authentication object.</i>
*
* @return true
*/
public function deleteWebhook($authentication = null) {
$args = func_get_args();

View File

@ -85,6 +85,8 @@ function wc_get_raw_referer() {
* @param int|array $products
* @param bool $show_qty Should qty's be shown? Added in 2.6.0
* @param bool $return Return message rather than add it.
*
* @return mixed|void
*/
function wc_add_to_cart_message( $products, $show_qty = false, $return = false ) {
$titles = array();
@ -245,8 +247,11 @@ function wc_cart_totals_taxes_total_html() {
* Get a coupon label.
*
* @access public
*
* @param string $coupon
* @param bool $echo or return
*
* @return string
*/
function wc_cart_totals_coupon_label( $coupon, $echo = true ) {
if ( is_string( $coupon ) ) {

View File

@ -211,7 +211,10 @@ function wc_get_template( $template_name, $args = array(), $template_path = '',
* Like wc_get_template, but returns the HTML instead of outputting.
* @see wc_get_template
* @since 2.5.0
*
* @param string $template_name
*
* @return string
*/
function wc_get_template_html( $template_name, $args = array(), $template_path = '', $default_path = '' ) {
ob_start();

View File

@ -19,9 +19,12 @@ if ( ! defined( 'ABSPATH' ) ) {
* Uses queries rather than update_post_meta so we can do this in one query (to avoid stock issues).
*
* @since 3.0.0 this supports set, increase and decrease.
*
* @param int|WC_Product $product
* @param int|null $stock_quantity
* @param string $operation set, increase and decrease.
*
* @return bool|int|null
*/
function wc_update_product_stock( $product, $stock_quantity = null, $operation = 'set' ) {
if ( ! $product = wc_get_product( $product ) ) {

View File

@ -286,8 +286,11 @@ function wc_get_loop_class() {
* Get the classes for the product cat div.
*
* @since 2.4.0
*
* @param string|array $class One or more classes to add to the class list.
* @param object $category object Optional.
*
* @return array
*/
function wc_get_product_cat_class( $class = '', $category = null ) {
$classes = is_array( $class ) ? $class : array_map( 'trim', explode( ' ', $class ) );
@ -367,9 +370,12 @@ function wc_product_post_class( $classes, $class = '', $post_id = '' ) {
/**
* Outputs hidden form inputs for each query string variable.
* @since 3.0.0
*
* @param array $values Name value pairs.
* @param array $exclude Keys to exclude.
* @param string $current_key Current key we are outputting.
*
* @return string
*/
function wc_query_string_form_fields( $values = null, $exclude = array(), $current_key = '', $return = false ) {
if ( is_null( $values ) ) {
@ -1056,6 +1062,8 @@ if ( ! function_exists( 'woocommerce_quantity_input' ) ) {
* @param array $args Args for the input
* @param WC_Product|null $product
* @param boolean $echo Whether to return or echo|string
*
* @return string
*/
function woocommerce_quantity_input( $args = array(), $product = null, $echo = true ) {
if ( is_null( $product ) ) {
@ -1876,10 +1884,13 @@ if ( ! function_exists( 'woocommerce_form_field' ) ) {
/**
* Outputs a checkout/address form field.
*
* @subpackage Forms
* @subpackage Forms
*
* @param string $key
* @param mixed $args
* @param string $value (default: null)
*
* @return string
*/
function woocommerce_form_field( $key, $args, $value = null ) {
$defaults = array(
@ -2377,9 +2388,12 @@ if ( ! function_exists( 'wc_no_products_found' ) ) {
if ( ! function_exists( 'wc_get_email_order_items' ) ) {
/**
* Get HTML for the order items to be shown in emails.
*
* @param WC_Order $order
* @param array $args
*
* @since 3.0.0
* @return string
*/
function wc_get_email_order_items( $order, $args = array() ) {
ob_start();