WP_REST_Plugins_Controller::prepare_links()
Prepares links for the request.
Method of the class: WP_REST_Plugins_Controller{}
No Hooks.
Return
Array[]
.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_links( $item );
- $item(array) (required)
- The plugin item.
Changelog
Since 5.5.0 | Introduced. |
WP_REST_Plugins_Controller::prepare_links() WP REST Plugins Controller::prepare links code WP 6.3
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 ) ) ), ), ); }