Shortcode_Controller::prepare_item_for_response( array $args, WP_REST_Request $request )
Summary
Prepares a single product output for response.
Parameters
- $args
-
(array) (Required) Shortcode args
- $request
-
(WP_REST_Request) (Required) Request object.
Return
(WP_REST_Response) Response object.
Source
File: src/BigCommerce/Rest/Shortcode_Controller.php
public function prepare_item_for_response( $args, $request ) { $shortcode = $this->build_shortcode_string( $args ); // Wrap the data in a response object. $response = rest_ensure_response( [ 'shortcode' => $shortcode, 'attributes' => $args, ] ); /** * Filters the product data for a response. * * @param \WP_REST_Response $response The response object. * @param \WP_Post $post Post object. * @param \WP_REST_Request $request Request object. */ return apply_filters( 'bigcommerce/rest/shortcode/prepare_item_for_response', $response, $shortcode, $request ); }