WP_REST_Widget_Types_Controller::prepare_links
Prepares links for the widget type.
Method of the class: WP_REST_Widget_Types_Controller{}
No Hooks.
Returns
Array. Links for the given widget type.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_links( $widget_type );
- $widget_type(array) (required)
- Widget type data.
Changelog
| Since 5.8.0 | Introduced. |
WP_REST_Widget_Types_Controller::prepare_links() WP REST Widget Types Controller::prepare links code WP 6.8.3
protected function prepare_links( $widget_type ) {
return array(
'collection' => array(
'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ),
),
'self' => array(
'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $widget_type['id'] ) ),
),
);
}