Shortcode_Controller::get_rendered_item( WP_REST_Request $request )
Summary
Retrieves a single shortcode
Parameters
- $request
-
(WP_REST_Request) (Required) Full details about the request.
Return
(WP_REST_Response|WP_Error) Response object on success, or WP_Error object on failure.
Source
File: src/BigCommerce/Rest/Shortcode_Controller.php
public function get_rendered_item( $request ) { $attributes = $request->get_params(); $attributes = array_filter( $attributes, function ( $att ) { return isset( $att ); } ); $shortcode = $this->build_shortcode_string( $attributes ); $output = do_shortcode( $shortcode ); $response = rest_ensure_response( [ 'rendered' => $output, ] ); return $response; }
Changelog
Version | Description |
---|---|
4.7.0 | Introduced. |