WP_REST_Plugins_Controller::prepare_links() WordPress Method
The WP_REST_Plugins_Controller::prepare_links() method is used to prepare the links for a plugin. This is typically done before the plugin is registered with the WordPress REST API.
WP_REST_Plugins_Controller::prepare_links( array $item ) #
Prepares links for the request.
Parameters
- $item
(array)(Required)The plugin item.
Return
(array[])
Source
File: wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php
protected function prepare_links( $item ) { return array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $item['_file'], 0, - 4 ) ) ), ), ); }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |