Make WordPress Core


Ignore:
Timestamp:
04/28/2023 03:04:19 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Coding Standards: Bring some consistency to REST API revisions initialization.

The autosaves and revisions controllers used to set the same class properties in a slightly different order.

This commit makes the ::__construct() methods of both classes more consistent to simplify future maintenance.

Follow-up to [46272], [51962].

See #57839.

File:
1 edited

Legend:

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

    r55154 r55697  
    6969                $this->revisions_controller = new WP_REST_Revisions_Controller( $parent_post_type );
    7070                $this->rest_base            = 'autosaves';
     71                $this->parent_base          = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
    7172                $this->namespace            = ! empty( $post_type_object->rest_namespace ) ? $post_type_object->rest_namespace : 'wp/v2';
    72                 $this->parent_base          = ! empty( $post_type_object->rest_base ) ? $post_type_object->rest_base : $post_type_object->name;
    7373        }
    7474
Note: See TracChangeset for help on using the changeset viewer.