Automattic\WooCommerce\Admin\API

NavigationFavorites::get_items()publicWC 1.0

Get all favorites.

Method of the class: NavigationFavorites{}

No Hooks.

Return

WP_REST_Response.

Usage

$NavigationFavorites = new NavigationFavorites();
$NavigationFavorites->get_items( $request );
$request(WP_REST_Request) (required)
Request data.

NavigationFavorites::get_items() code WC 7.3.0

public function get_items( $request ) {
	$response = Favorites::get_all( get_current_user_id() );

	if ( is_wp_error( $response ) || ! $response ) {
		return rest_ensure_response( $this->prepare_error( $response ) );
	}

	return rest_ensure_response(
		array_map( 'stripslashes', $response )
	);
}