[wp-trac] [WordPress Trac] #45269: REST API: `rest_insert_attachment` and `rest_after_insert_attachment` actions fire twice on update.
WordPress Trac
noreply at wordpress.org
Sat Nov 3 23:57:16 UTC 2018
#45269: REST API: `rest_insert_attachment` and `rest_after_insert_attachment`
actions fire twice on update.
--------------------------------------+------------------------------
Reporter: peterwilsoncc | Owner: danielbachhuber
Type: defect (bug) | Status: closed
Priority: normal | Milestone: 5.0
Component: REST API | Version: 5.0
Severity: normal | Resolution: fixed
Keywords: has-patch has-unit-tests | Focuses: rest-api
--------------------------------------+------------------------------
Comment (by danielbachhuber):
@peterwilsoncc Hm, good question. It exposes the problem that if you're
providing an endpoint implementation that subclasses one of the core
controllers, then we run into the execution order problem again.
With this being said, I'm not sure how much subclassing is the formally
supported extensibility pattern. I think it'd be much more common for
developers to either use `register_rest_field()`, or write completely
custom controllers.
At this point, I don't have a strong feeling on the appropriate path
forward. I'd love to know more about how serious of a real-world problem
this is, vs. simply a theoretical concern.
More specifically, in the Jetpack and Yoast examples outlined in
https://core.trac.wordpress.org/ticket/45114#comment:7, it would be really
valuable to know:
1. What is the specific bug that the issue causes.
2. What's the level of effort and complexity to implement an alternative
workaround.
With this information, we can better assess the severity of the issue.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45269#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list