Subir ajustes de acordeon y SEO

This commit is contained in:
Gabriel
2026-10-23 11:18:13 -06:00
parent 03333c3ce7
commit 14b96152a5
103 changed files with 6638 additions and 5316 deletions
@@ -3453,6 +3453,21 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
$response_request['_fields'] = $request['_fields'];
}
/*
* Re-read the post. The 'wp_generate_attachment_metadata' filter above
* runs long after $post was fetched, and a callback that rewrites the
* post row - an optimizer changing post_mime_type once it has
* converted the file, say - would otherwise be missing from this
* response. The editor stores the response as its copy of the record
* rather than reading the attachment again, so a stale row here is
* what it keeps. A callback that deleted the attachment instead leaves
* nothing to respond with, so that is reported as the error it is.
*/
$post = $this->get_post( $attachment_id );
if ( is_wp_error( $post ) ) {
return $post;
}
return $this->prepare_item_for_response( $post, $response_request );
}
}