프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$base | string | the route base |
메소드 | 설명 | |
---|---|---|
bulk ( array $data ) : array | Bulk update or insert products Accepts an array with products in the formats supported by WC_API_Products->create_product() and WC_API_Products->edit_product() | |
create_product ( array $data ) : array | Create a new product | |
create_product_attribute ( array $data ) : array | Create a new product attribute | |
create_product_attribute_term ( integer $attribute_id, array $data ) : array | Create a new product attribute term. | |
create_product_category ( array $data ) : array | WP_Error | Create a new product category. | |
create_product_shipping_class ( array $data ) : array | WP_Error | Create a new product shipping class. | |
create_product_tag ( array $data ) : array | WP_Error | Create a new product tag. | |
delete_product ( integer $id, boolean $force = false ) : array | Delete a product | |
delete_product_attribute ( integer $id ) : array | Delete a product attribute | |
delete_product_attribute_term ( integer $attribute_id, integer $id ) : array | Delete a product attribute term. | |
delete_product_category ( integer $id ) : array | WP_Error | Delete a product category. | |
delete_product_shipping_class ( integer $id ) : array | WP_Error | Delete a product shipping class. | |
delete_product_tag ( integer $id ) : array | WP_Error | Delete a product tag. | |
edit_product ( integer $id, array $data ) : array | Edit a product | |
edit_product_attribute ( integer $id, array $data ) : array | Edit a product attribute | |
edit_product_attribute_term ( integer $attribute_id, integer $id, array $data ) : array | Edit a product attribute term. | |
edit_product_category ( integer $id, array $data ) : array | WP_Error | Edit a product category. | |
edit_product_shipping_class ( integer $id, array $data ) : array | WP_Error | Edit a product shipping class. | |
edit_product_tag ( integer $id, array $data ) : array | WP_Error | Edit a product tag. | |
get_product ( integer $id, string $fields = null ) : array | Get the product for the given ID | |
get_product_attribute ( string $id, string | null $fields = null ) : array | Get the product attribute for the given ID | |
get_product_attribute_term ( integer $attribute_id, string $id, string | null $fields = null ) : array | Get the product attribute term for the given ID. | |
get_product_attribute_terms ( integer $attribute_id, string | null $fields = null ) : array | Get a listing of product attribute terms. | |
get_product_attributes ( string | null $fields = null ) : array | Get a listing of product attributes | |
get_product_by_sku ( integer $sku, string $fields = null ) : array | Get product by SKU | |
get_product_categories ( string | null $fields = null ) : array | Get a listing of product categories | |
get_product_category ( string $id, string | null $fields = null ) : array | Get the product category for the given ID | |
get_product_orders ( integer $id, $fields = null, string $filter = [], string $status = null, $page = 1 ) : array | Get the orders for a product | |
get_product_reviews ( integer $id, string $fields = null ) : array | Get the reviews for a product | |
get_product_shipping_class ( string $id, string | null $fields = null ) : array | WP_Error | Get the product shipping class for the given ID. | |
get_product_shipping_classes ( string | null $fields = null ) : array | WP_Error | Get a listing of product shipping classes. | |
get_product_tag ( string $id, string | null $fields = null ) : array | Get the product tag for the given ID. | |
get_product_tags ( string | null $fields = null ) : array | Get a listing of product tags. | |
get_products ( string $fields = null, string $type = null, array $filter = [], integer $page = 1 ) : array | Get all products | |
get_products_count ( string $type = null, array $filter = [] ) : array | Get the total number of orders | |
register_routes ( array $routes ) : array | Register the routes for this class | |
upload_product_category_image ( string $image_url ) : integer | WP_Error | Upload product category image from URL. | |
upload_product_image ( string $image_url ) : integer | WP_Error | Upload image from URL |
메소드 | 설명 | |
---|---|---|
clear_product ( $product_id ) | Clear product | |
get_attribute_options ( integer $product_id, array $attribute ) : array | Get attribute options. | |
save_default_attributes ( WC_Product $product, WP_REST_Request $request ) : WC_Product | Save default attributes. | |
save_default_attributes ( WC_Product $product, array $request ) : WC_Product | Save default attributes. | |
save_product_images ( WC_Product $product, array $images ) | Save product images | |
save_product_images ( WC_Product $product, array $images ) : WC_Product | Save product images. | |
save_product_meta ( WC_Product $product, array $data ) : WC_Product | Save product meta | |
save_variations ( WC_Product $product, array $request ) : WC_Product | Save variations | |
set_product_category_image_as_attachment ( integer $upload ) : integer | Sets uploaded category image as attachment and returns the attachment ID. | |
set_product_image_as_attachment ( array $upload, integer $id ) : integer | Sets product image as attachment and returns the attachment ID. | |
set_uploaded_image_as_attachment ( array $upload, integer $id ) : integer | Set uploaded image as attachment. | |
upload_image_from_url ( string $image_url, string $upload_for = 'product_image' ) : integer | WP_Error | Upload image from URL. | |
validate_attribute_data ( string $name, string $slug, string $type, string $order_by, boolean $new_data = true ) : boolean | Validate attribute data. |
메소드 | 설명 | |
---|---|---|
get_attribute_taxonomy_by_slug ( string $slug ) : string | null | Get attribute taxonomy by slug. | |
get_attributes ( WC_Product | WC_Product_Variation $product ) : array | Get the attributes for a product or product variation | |
get_downloads ( WC_Product | WC_Product_Variation $product ) : array | Get the downloads for a product or product variation | |
get_grouped_products_data ( WC_Product $product ) : array | Get grouped products data | |
get_images ( WC_Product | WC_Product_Variation $product ) : array | Get the images for a product or product variation | |
get_product_data ( WC_Product $product ) : WC_Product | Get standard product data that applies to every product type | |
get_product_data ( WC_Product $product ) : array | Get standard product data that applies to every product type | |
get_product_menu_order ( WC_Product $product ) : integer | Get product menu order. | |
get_variation_data ( WC_Product $product ) : array | Get an individual variation's data | |
query_products ( array $args ) : WP_Query | Helper method to get product post objects | |
save_downloadable_files ( WC_Product $product, array $downloads, integer $deprecated ) : WC_Product | Save downloadable files | |
save_product_shipping_data ( WC_Product $product, array $data ) : WC_Product | Save product shipping data |
public create_product ( array $data ) : array | ||
$data | array | posted data |
리턴 | array |
public create_product_attribute ( array $data ) : array | ||
$data | array | posted data |
리턴 | array |
public create_product_category ( array $data ) : array | WP_Error | ||
$data | array | Posted data |
리턴 | array | WP_Error | Product category if succeed, otherwise WP_Error will be returned |
public create_product_shipping_class ( array $data ) : array | WP_Error | ||
$data | array | Posted data |
리턴 | array | WP_Error | Product shipping class if succeed, otherwise WP_Error will be returned |
public create_product_tag ( array $data ) : array | WP_Error | ||
$data | array | Posted data |
리턴 | array | WP_Error | Product tag if succeed, otherwise WP_Error will be returned |
public delete_product_attribute ( integer $id ) : array | ||
$id | integer | the product attribute ID |
리턴 | array |
public delete_product_category ( integer $id ) : array | WP_Error | ||
$id | integer | Product category term ID |
리턴 | array | WP_Error | Success message if succeed, otherwise WP_Error will be returned |
public delete_product_shipping_class ( integer $id ) : array | WP_Error | ||
$id | integer | Product shipping class term ID |
리턴 | array | WP_Error | Success message if succeed, otherwise WP_Error will be returned |
public delete_product_tag ( integer $id ) : array | WP_Error | ||
$id | integer | Product tag term ID |
리턴 | array | WP_Error | Success message if succeed, otherwise WP_Error will be returned |
public register_routes ( array $routes ) : array | ||
$routes | array | |
리턴 | array |
protected save_default_attributes ( WC_Product $product, WP_REST_Request $request ) : WC_Product | ||
$product | WC_Product | |
$request | WP_REST_Request | |
리턴 | WC_Product |
protected save_default_attributes ( WC_Product $product, array $request ) : WC_Product | ||
$product | WC_Product | |
$request | array | |
리턴 | WC_Product |
protected save_product_images ( WC_Product $product, array $images ) | ||
$product | WC_Product | |
$images | array |
protected save_product_images ( WC_Product $product, array $images ) : WC_Product | ||
$product | WC_Product | |
$images | array | |
리턴 | WC_Product |
protected save_product_meta ( WC_Product $product, array $data ) : WC_Product | ||
$product | WC_Product | |
$data | array | |
리턴 | WC_Product |
protected save_variations ( WC_Product $product, array $request ) : WC_Product | ||
$product | WC_Product | |
$request | array | |
리턴 | WC_Product |
protected set_product_category_image_as_attachment ( integer $upload ) : integer | ||
$upload | integer | Upload information from wp_upload_bits |
리턴 | integer | Attachment ID |
public upload_product_category_image ( string $image_url ) : integer | WP_Error | ||
$image_url | string | |
리턴 | integer | WP_Error | attachment id |
public upload_product_image ( string $image_url ) : integer | WP_Error | ||
$image_url | string | |
리턴 | integer | WP_Error | attachment id |