Automattic\WooCommerce\Admin\API
ProductVariations::get_items
Get a collection of posts and add the post title filter option to WP_Query.
Метод класса: ProductVariations{}
Хуков нет.
Возвращает
WP_Error|WP_REST_Response.
Использование
$ProductVariations = new ProductVariations(); $ProductVariations->get_items( $request );
- $request(WP_REST_Request) (обязательный)
- Full details about the request.
Код ProductVariations::get_items() ProductVariations::get items WC 10.3.4
public function get_items( $request ) {
add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10, 2 );
add_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10, 2 );
add_filter( 'posts_groupby', array( 'Automattic\WooCommerce\Admin\API\Products', 'add_wp_query_group_by' ), 10, 2 );
$response = parent::get_items( $request );
remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_filter' ), 10 );
remove_filter( 'posts_join', array( __CLASS__, 'add_wp_query_join' ), 10 );
remove_filter( 'posts_groupby', array( 'Automattic\WooCommerce\Admin\API\Products', 'add_wp_query_group_by' ), 10 );
return $response;
}