Edit: On January 14, 2019, the Good and Bad Practices section was added to show both correct and incorrect code examples. Starting in WordPress 5.1, if register_rest_route() is not called on the rest_api_init action hook, a “doing it wrong” notice will be triggered. This notice is being added in an effort to encourage best practices … Continue reading New REST API Notice in 5.1