Make WordPress Core


Ignore:
Timestamp:
07/19/2022 04:20:54 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-plugins-controller.php

    r51657 r53724  
    626626        return array(
    627627            'self' => array(
    628                 'href' => rest_url( sprintf( '%s/%s/%s', $this->namespace, $this->rest_base, substr( $item['_file'], 0, - 4 ) ) ),
     628                'href' => rest_url(
     629                    sprintf(
     630                        '%s/%s/%s',
     631                        $this->namespace,
     632                        $this->rest_base,
     633                        substr( $item['_file'], 0, - 4 )
     634                    )
     635                ),
    629636            ),
    630637        );
Note: See TracChangeset for help on using the changeset viewer.