plugin updates
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
/**
|
||||
* REST API Brands controller.
|
||||
*
|
||||
* Handles requests to /products/brands endpoint.
|
||||
*
|
||||
* Important: For internal use only by the Automattic\WooCommerce\Internal\Brands package.
|
||||
*
|
||||
* @package WooCommerce\RestApi
|
||||
* @since 9.4.0
|
||||
*/
|
||||
|
||||
declare( strict_types = 1);
|
||||
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
/**
|
||||
* REST API Brands controller class.
|
||||
*
|
||||
* @package WooCommerce\RestApi
|
||||
* @extends WC_REST_Product_Categories_Controller
|
||||
*/
|
||||
class WC_REST_Product_Brands_Controller extends WC_REST_Product_Categories_Controller {
|
||||
|
||||
/**
|
||||
* Route base.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $rest_base = 'products/brands';
|
||||
|
||||
/**
|
||||
* Taxonomy.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $taxonomy = 'product_brand';
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ class WC_REST_Product_Reviews_Controller extends WC_REST_Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the reivew, if the ID is valid.
|
||||
* Get the review, if the ID is valid.
|
||||
*
|
||||
* @since 3.5.0
|
||||
* @param int $id Supplied ID.
|
||||
|
||||
@@ -53,7 +53,7 @@ class WC_REST_Product_Shipping_Classes_Controller extends WC_REST_Product_Shippi
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback fuction for the slug-suggestion endpoint.
|
||||
* Callback function for the slug-suggestion endpoint.
|
||||
*
|
||||
* @param WP_REST_Request $request Full details about the request.
|
||||
* @return string The suggested slug.
|
||||
|
||||
@@ -446,7 +446,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Product_Variations_V
|
||||
|
||||
if ( is_wp_error( $upload ) ) {
|
||||
/**
|
||||
* Filter to check if it should supress the image upload error, false by default.
|
||||
* Filter to check if it should suppress the image upload error, false by default.
|
||||
*
|
||||
* @since 4.5.0
|
||||
* @param bool false If it should suppress.
|
||||
|
||||
@@ -232,7 +232,7 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
|
||||
}
|
||||
|
||||
if ( wc_product_sku_enabled() ) {
|
||||
// Do a partial match for a sku. Supercedes sku parameter that does exact matching.
|
||||
// Do a partial match for a sku. Supersedes sku parameter that does exact matching.
|
||||
if ( ! empty( $request['search_sku'] ) ) {
|
||||
// Store this for use in the query clause filters.
|
||||
$this->search_sku_in_product_lookup_table = $request['search_sku'];
|
||||
@@ -259,6 +259,18 @@ class WC_REST_Products_Controller extends WC_REST_Products_V2_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $request['global_unique_id'] ) ) {
|
||||
$global_unique_ids = array_map( 'trim', explode( ',', $request['global_unique_id'] ) );
|
||||
$args['meta_query'] = $this->add_meta_query( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
|
||||
$args,
|
||||
array(
|
||||
'key' => '_global_unique_id',
|
||||
'value' => $global_unique_ids,
|
||||
'compare' => 'IN',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Filter by tax class.
|
||||
if ( ! empty( $request['tax_class'] ) ) {
|
||||
$args['meta_query'] = $this->add_meta_query( // WPCS: slow query ok.
|
||||
|
||||
Reference in New Issue
Block a user