Make WordPress Core

Ticket #50759: 50759.patch

File 50759.patch, 931 bytes (added by ramiy, 6 years ago)
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

     
    24242424                // Emit a _doing_it_wrong warning if user tries to add new properties using this filter.
    24252425                $new_fields = array_diff( array_keys( $schema['properties'] ), $schema_fields );
    24262426                if ( count( $new_fields ) > 0 ) {
    2427                         _doing_it_wrong( __METHOD__, __( 'Please use register_rest_field to add new schema properties.' ), '5.4.0' );
     2427                        _doing_it_wrong(
     2428                                __METHOD__,
     2429                                sprintf(
     2430                                        /* translators: %s: register_rest_field */
     2431                                        __( 'Please use %s to add new schema properties.' ),
     2432                                        '<code>register_rest_field<code>'
     2433                                ),
     2434                                '5.4.0'
     2435                        );
    24282436                }
    24292437
    24302438                $this->schema = $schema;