WordPress at a glance
function is not described


Coupons::get_items() public WC 1.0

Get a collection of posts and add the code search option to WP_Query.

{} It's a method of the class: Coupons{}

No Hooks.


WP_Error|WP_REST_Response. Nothing.


$Coupons = new Coupons();
$Coupons->get_items( $request );
$request(WP_REST_Request) (required)
Full details about the request.

Code of Coupons::get_items() WC 5.3.0

public function get_items( $request ) {
	add_filter( 'posts_where', array( __CLASS__, 'add_wp_query_search_code_filter' ), 10, 2 );
	$response = parent::get_items( $request );
	remove_filter( 'posts_where', array( __CLASS__, 'add_wp_query_search_code_filter' ), 10 );
	return $response;