[wp-trac] [WordPress Trac] #54087: A plugin can't change the parameters of a REST API endpoint

WordPress Trac noreply at wordpress.org
Sun Dec 11 14:52:01 UTC 2022


#54087: A plugin can't change the parameters of a REST API endpoint
---------------------------+------------------------------
 Reporter:  antonvlasenko  |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  REST API       |     Version:  5.9
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  rest-api
---------------------------+------------------------------

Comment (by TimothyBlynJacobs):

 I don't have any context here, why this function was implemented without a
 filter was probably a very early decision.

 Personally, I worry that such a low-level filter will get abused to add
 parameters to controllers without using the more intentional exposed APIs
 like `register_rest_field`.

 I'm of the opinion that if controllers want to make portions of their
 route registration customizable, they should provide specific filters for
 that.

 Gutenberg has pretty specialized needs as a place for prototyping features
 for Core, but I don't think we should be encouraging plugin developers to
 do the same.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54087#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list