[wp-trac] [WordPress Trac] #40600: get_item filter for hijacking single post request
WordPress Trac
noreply at wordpress.org
Wed May 3 11:56:36 UTC 2017
#40600: get_item filter for hijacking single post request
-------------------------------------------------+-------------------------
Reporter: ruud@… | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting
Component: REST API | Review
Severity: normal | Version: 4.7
Keywords: has-patch has-unit-tests dev- | Resolution:
feedback | Focuses:
-------------------------------------------------+-------------------------
Comment (by ruud@…):
Hi,
This may still be a valid addition to core but I managed to get the job
done via extending the WP_REST_Posts_Controller class and using my own
custom class to add the desired additional check in the get_item() method.
Use your own custom Controller via the post-type registration:
'rest_controller_class' => 'Custom_REST_Posts_Controller',
Thanks,
Ruud
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40600#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list