You appear to be a bot. Output may be restricted
Description
Process Get Products API Request
Usage
$array = EDD_API::get_products( $args );
Parameters
- $args
- ( mixed ) optional –
Returns
array $customers Multidimensional array of the products
Source
File name: easy-digital-downloads/includes/api/class-edd-api.php
Lines:
1 to 44 of 44
public function get_products( $args = array() ) { $products = array(); $error = array(); if ( empty( $args['product'] ) ) { $products['products'] = array(); $parameters = array( 'post_type' => 'download', 'posts_per_page' => $this->per_page(), 'suppress_filters' => true, 'paged' => $this->get_paged(), ); if ( isset( $args['s'] ) && !empty( $args['s'] ) ) { $parameters['s'] = $args['s']; } $product_list = get_posts( $parameters ); if ( $product_list ) { $i = 0; foreach ( $product_list as $product_info ) { $products['products'][$i] = $this->get_product_data( $product_info ); $i++; } } } else { if ( get_post_type( $args['product'] ) == 'download' ) { $product_info = get_post( $args['product'] ); $products['products'][0] = $this->get_product_data( $product_info ); } else { $error['error'] = sprintf( __( 'Product %s not found!', 'easy-digital-downloads' ), $args['product'] ); return $error; } } return apply_filters( 'edd_api_products', $products, $this ); }