@@ -142,7 +142,7 @@ public function init() {
142142 add_action ( 'before_delete_post ' , array ( $ this , 'delete_size_relationship ' ) );
143143 add_action ( 'delete_attachment ' , array ( $ this , 'delete_size_relationship ' ) );
144144 add_action ( 'cloudinary_register_sync_types ' , array ( $ this , 'register_sync_type ' ), 30 );
145- add_action ( 'rest_request_before_callbacks ' , array ( $ this , 'maybe_unset_attributes ' ), 10 , 3 );
145+ add_filter ( 'rest_request_before_callbacks ' , array ( $ this , 'maybe_unset_attributes ' ), 10 , 3 );
146146 add_action (
147147 'the_post ' ,
148148 function ( $ post ) {
@@ -166,7 +166,7 @@ function ( $post ) {
166166 * @param WP_REST_Server $handler The request handler.
167167 * @param WP_REST_Request|null $request The request object, if available.
168168 *
169- * @return void
169+ * @return WP_REST_Response
170170 */
171171 public function maybe_unset_attributes ( $ response , $ handler , $ request ) {
172172 $ route = $ request ->get_route ();
@@ -180,6 +180,8 @@ public function maybe_unset_attributes( $response, $handler, $request ) {
180180 ) {
181181 add_filter ( 'cloudinary_skip_parse_element ' , '__return_true ' );
182182 }
183+
184+ return $ response ;
183185 }
184186
185187 /**
0 commit comments