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-block-types-controller.php

    r53197 r53724  
    348348        if ( $block_type->is_dynamic() ) {
    349349            $links['https://api.w.org/render-block'] = array(
    350                 'href' => add_query_arg( 'context', 'edit', rest_url( sprintf( '%s/%s/%s', 'wp/v2', 'block-renderer', $block_type->name ) ) ),
     350                'href' => add_query_arg(
     351                    'context',
     352                    'edit',
     353                    rest_url( sprintf( '%s/%s/%s', 'wp/v2', 'block-renderer', $block_type->name ) )
     354                ),
    351355            );
    352356        }
Note: See TracChangeset for help on using the changeset viewer.