File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
plugins/dominant-color-images Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -251,15 +251,18 @@ function dominant_color_admin_script(): void {
251
251
*
252
252
* @since 1.2.0
253
253
*
254
- * @param array<mixed>|mixed $response The current response array for the attachment.
255
- * @param WP_Post $attachment The attachment post object.
256
- * @param array<mixed> $meta The attachment metadata.
257
- * @return array<mixed> The modified response array with added dominant color and transparency information.
254
+ * @param array<string, mixed>|mixed $response The current response array for the attachment.
255
+ * @param WP_Post $attachment The attachment post object.
256
+ * @param array<string, mixed>|false $meta The attachment metadata.
257
+ * @return array<string, mixed> The modified response array with added dominant color and transparency information.
258
258
*/
259
- function dominant_color_prepare_attachment_for_js ( $ response , WP_Post $ attachment , array $ meta ): array {
259
+ function dominant_color_prepare_attachment_for_js ( $ response , WP_Post $ attachment , $ meta ): array {
260
260
if ( ! is_array ( $ response ) ) {
261
261
$ response = array ();
262
262
}
263
+ if ( ! is_array ( $ meta ) ) {
264
+ return $ response ;
265
+ }
263
266
264
267
$ response ['dominantColor ' ] = '' ;
265
268
if (
You can’t perform that action at this time.
0 commit comments