mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Coding Standards: Use consistent placement for ::prepare_links() methods.
This moves the `::prepare_links()` methods in REST API classes next to `::prepare_item_for_response()` where they are used, to bring some consistency across the classes and make code navigation easier. Includes wrapping some long lines for better readability. Follow-up to [52079], [52051], [52342], [53721], [53722]. See #55647. git-svn-id: https://develop.svn.wordpress.org/trunk@53724 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -625,7 +625,14 @@ class WP_REST_Plugins_Controller extends WP_REST_Controller {
|
||||
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 ) ) ),
|
||||
'href' => rest_url(
|
||||
sprintf(
|
||||
'%s/%s/%s',
|
||||
$this->namespace,
|
||||
$this->rest_base,
|
||||
substr( $item['_file'], 0, - 4 )
|
||||
)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user