-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking: Core data revisions follow ups #56413
Comments
Dumping some research here. Adding revisions support info to the /**
* Returns post type supports data in the request's view context.
*
* @since 6.5.0
*
* @param WP_REST_Response $response The response object.
* @param WP_Post_Type $post_type The original post type object.
* @param WP_REST_Request $request Request used to generate the response.
*/
function gutenberg_rest_prepare_post_type_add_support( $response, $post_type, $request ) {
if ( 'view' === $request['context'] ) {
$supports = get_all_post_type_supports( $post_type->name );
if ( isset( $supports['revisions'] ) && true === $supports['revisions'] ) {
$response->data['supports']['revisions'] = true;
}
}
return $response;
}
add_filter( 'rest_prepare_post_type', 'gutenberg_rest_prepare_post_type_add_support', 10, 3 ); The question is: what's the best path to Core migration? 🤔 Do we want to return revision supports info for all If yes......then we could modify The next question is, is this okay out of the edit context? I'm not sure but I can't see why not. And do we have to worry about returning data that folks don't expect? We're not removing data, and the structure would mirror the If no...We could ask for supports information via a request parameter or something? E.g., We'd need to modify It seems undesirable to add a non-standard parameter in this way. And not great for maintenance. Edit: #56701 addresses this issue by letting the server decide :) |
Closing this issue now, since all directly related issues are resolved. #56355 was an existing core data issue and not related to revisions. |
A list of tasks/bugs to address related to the following PR:
Tasks/Bugs
getRevisions()
thengetRevision
replaces current items state. Core data: harmonize getRevision selector and resolver function signatures #56416getRevisions()
thengetRevision()
doesn't return cached store item (makes an unnecessary API call) Core data: harmonize getRevision selector and resolver function signatures #56416getRevisions
for global styles revisions as per the above diff and potentially deprecategetCurrentThemeGlobalStylesRevisions
Global styles revisions: migrate API call to getRevisions() #56349WP_REST_Global_Styles_Revisions_Controller
REST API class to handle fetching individual revisions: Global styles revisions: add route for single styles revisions #55827Core data: selectors return stale data despite different query parameters #56355Related
The text was updated successfully, but these errors were encountered: