You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that the "editor" setting is the only way to enable Sugar Calendar events via REST, but it doesn't seem to be possible to use the classic editor and also use REST. It would be nice if it were possible to use the classic editor and REST.
I think this is happening because the block editor is being disabled by manipulating the show_in_rest parameter. This solves the problem, but it disables the Sugar Calendar in REST endpoint, as well.
Instead, I suggest that Sugar Calendar always leaves the show_in_rest as true, and instead uses the'use_block_editor_for_post_type' filter is used to disable/enable the block-based editor. This will make it possible to switch between editors and still keep the REST API intact.
To Replicate:
Set the editor setting to the block-based editor
Visit {your-site}/wp-json/wp/v2/sc_event
Observe post data response
Change the editor setting to the classic editor
Visit {your-site}/wp-json/wp/v2/sc_event
Note that the REST endpoint is not available
The text was updated successfully, but these errors were encountered:
I see what you're saying. I used the show_in_rest parameter because the use_block_editor_for_post_type function returns true by default instead of false, and Sugar Calendar technically still requires the opposite to avoid the double-negative of having our false setting mean true in the filter.
WordPress never should have forced the default to true there. 😤
Also, I didn't want to publicly expose only the Post Type (Events) and Taxonomy (Calendars) data without offering something for the data currently covered by BerlinDB (Dates, Times, Recurring, etc...)
It seemed inevitable to me that exposing the easy stuff immediately reveals to API users that the hard stuff is not available. When we do it, I don't want us to rush to do it because we shipped something halfway.
It appears that the "editor" setting is the only way to enable Sugar Calendar events via REST, but it doesn't seem to be possible to use the classic editor and also use REST. It would be nice if it were possible to use the classic editor and REST.
I think this is happening because the block editor is being disabled by manipulating the
show_in_rest
parameter. This solves the problem, but it disables the Sugar Calendar in REST endpoint, as well.Instead, I suggest that Sugar Calendar always leaves the
show_in_rest
as true, and instead uses the'use_block_editor_for_post_type'
filter is used to disable/enable the block-based editor. This will make it possible to switch between editors and still keep the REST API intact.To Replicate:
{your-site}/wp-json/wp/v2/sc_event
{your-site}/wp-json/wp/v2/sc_event
The text was updated successfully, but these errors were encountered: