Commit 8946881
committed
Media: Expose image_strip_meta and image_max_bit_depth in the REST index.
When client-side media processing is active, image decoding, scaling, and encoding happen in the browser, so no server-side `WP_Image_Editor` is instantiated. As a result the `image_strip_meta` and `image_max_bit_depth` filters never influence generated images, and plugins relying on them have no effect on client-generated sub-sizes.
Expose the filtered values of both hooks on the REST API index inside the existing client-side media processing block in `WP_REST_Server::get_index()`, alongside the already-exported `image_size_threshold`, so the client encoder can honor them. The client-side consumption of these values ships via the Gutenberg package updates in WordPress/gutenberg#80218.
Props westonruter, soyebsalar01.
Fixes #65623.
git-svn-id: https://develop.svn.wordpress.org/trunk@62806 602fd350-edb4-49c9-b593-d223f7449a821 parent e26ca28 commit 8946881
3 files changed
Lines changed: 86 additions & 0 deletions
File tree
- src/wp-includes/rest-api
- tests
- phpunit/tests/rest-api
- qunit/fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1384 | 1384 | | |
1385 | 1385 | | |
1386 | 1386 | | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
1387 | 1401 | | |
1388 | 1402 | | |
1389 | 1403 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1207 | 1207 | | |
1208 | 1208 | | |
1209 | 1209 | | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
1210 | 1280 | | |
1211 | 1281 | | |
1212 | 1282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13061 | 13061 | | |
13062 | 13062 | | |
13063 | 13063 | | |
| 13064 | + | |
| 13065 | + | |
13064 | 13066 | | |
13065 | 13067 | | |
13066 | 13068 | | |
| |||
0 commit comments