WordPress.org

Make WordPress Core

Changeset 48610


Ignore:
Timestamp:
07/25/2020 04:26:44 PM (2 months ago)
Author:
SergeyBiryukov
Message:

I18N: Move code out of a translatable string in WP_REST_Posts_Controller::get_item_schema().

Props ramiy.
Fixes #50759.

File:
1 edited

Legend:

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

    r48104 r48610  
    21932193            ),
    21942194        );
     2195
    21952196        foreach ( $post_type_attributes as $attribute ) {
    21962197            if ( isset( $fixed_schemas[ $this->post_type ] ) && ! in_array( $attribute, $fixed_schemas[ $this->post_type ], true ) ) {
     
    24252426        $new_fields = array_diff( array_keys( $schema['properties'] ), $schema_fields );
    24262427        if ( count( $new_fields ) > 0 ) {
    2427             _doing_it_wrong( __METHOD__, __( 'Please use register_rest_field to add new schema properties.' ), '5.4.0' );
     2428            _doing_it_wrong(
     2429                __METHOD__,
     2430                sprintf(
     2431                    /* translators: %s: register_rest_field */
     2432                    __( 'Please use %s to add new schema properties.' ),
     2433                    '<code>register_rest_field<code>'
     2434                ),
     2435                '5.4.0'
     2436            );
    24282437        }
    24292438
Note: See TracChangeset for help on using the changeset viewer.