WP_REST_Themes_Controller::prepare_links()
Prepares links for the request.
{} It's a method of the class: WP_REST_Themes_Controller{}
No Hooks.
Return
Array
. Links for the given block type.
Usage
// protected - for code of main (parent) or child class $result = $this->prepare_links( $theme );
- $theme(WP_Theme) (required)
- Theme data.
Changelog
Since 5.7.0 | Introduced. |
Code of WP_REST_Themes_Controller::prepare_links() WP REST Themes Controller::prepare links WP 5.9.3
protected function prepare_links( $theme ) { return array( 'self' => array( 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, $theme->get_stylesheet() ) ), ), 'collection' => array( 'href' => rest_url( sprintf( '%s/%s', $this->namespace, $this->rest_base ) ), ), ); }