Class WC_API_Products
-
WC_API_Resource
-
WC_API_Products
Methods summary
public
array
|
#
register_routes( array $routes )
Register the routes for this class
Register the routes for this class
GET /products GET /products/count GET /products/<id> GET
/products/<id>/reviews
Parameters
Returns
array
Since
2.1
|
public
array
|
#
get_products( string $fields = null, string $type = null, array $filter = array(), integer $page = 1 )
Get all products
Parameters
- $fields
string $fields
- $type
string $type
- $filter
array $filter
- $page
integer $page
Returns
array
Since
2.1
|
public
array
|
#
get_product( integer $id, string $fields = null )
Get the product for the given ID
Get the product for the given ID
Parameters
- $id
integer $id the product ID
- $fields
string $fields
Returns
array
Since
2.1
|
public
array
|
#
get_products_count( string $type = null, array $filter = array() )
Get the total number of orders
Get the total number of orders
Parameters
- $type
string $type
- $filter
array $filter
Returns
array
Since
2.1
|
public
array
|
#
edit_product( integer $id, array $data )
Edit a product
Parameters
- $id
integer $id the product ID
- $data
array $data
Returns
array
TODO
implement in 2.2
|
public
array
|
#
delete_product( integer $id, boolean $force = false )
Delete a product
Parameters
- $id
integer $id the product ID
- $force
boolean $force true to permanently delete order, false to move to trash
Returns
array
TODO
enable along with PUT/POST in 2.2
|
public
array
|
#
get_product_reviews( integer $id, string $fields = null )
Get the reviews for a product
Get the reviews for a product
Parameters
- $id
integer $id the product ID to get reviews for
- $fields
string $fields fields to include in response
Returns
array
Since
2.1
|
__construct()
,
delete()
,
filter_response_fields()
,
is_deletable()
,
is_editable()
,
is_readable()
,
maybe_add_meta()
,
merge_query_args()
,
validate_request()
Magic methods summary
Properties summary
$server