[wp-trac] [WordPress Trac] #44963: PHP Notice: Undefined variable in wp-includes/rest-api.php $args['type']
WordPress Trac
noreply at wordpress.org
Wed Nov 6 03:18:27 UTC 2019
#44963: PHP Notice: Undefined variable in wp-includes/rest-api.php $args['type']
-----------------------------------------+-----------------------
Reporter: weblogma | Owner: (none)
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: REST API | Version: 4.7
Severity: minor | Resolution: invalid
Keywords: has-patch reporter-feedback | Focuses: rest-api
-----------------------------------------+-----------------------
Changes (by TimothyBlynJacobs):
* status: new => closed
* version: => 4.7
* resolution: => invalid
* milestone: Awaiting Review =>
Comment:
Hi @weblogma,
I'm going to close out this ticket. At the moment, specifying a type for
your schema is required. Otherwise `rest_validate_value_from_schema` won't
have anything to do. If you don't want the default validator or sanitizers
to be called, you can manually set `validate_callback` and
`sanitize_callback` to `null`. For an example:
https://github.com/WordPress/wordpress-
develop/blob/75f82d8bc2b96074d67df09c371cfc1139c19d8c/src/wp-includes
/rest-api/endpoints/class-wp-rest-posts-controller.php#L2081
If you have a use case as to why the type should be optional, feel free to
comment and reopen the ticket.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44963#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list