File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
redux-core/inc/fields/gallery Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -35,12 +35,14 @@ public function render() {
35
35
36
36
foreach ( $ ids as $ attachment_id ) {
37
37
$ img = wp_get_attachment_image_src ( $ attachment_id );
38
- $ alt = wp_prepare_attachment_for_js ( $ attachment_id );
39
- $ alt = $ alt ['alt ' ] ?? '' ;
38
+ if ( ! false === $ img ) {
39
+ $ alt = wp_prepare_attachment_for_js ( $ attachment_id );
40
+ $ alt = $ alt ['alt ' ] ?? '' ;
40
41
41
- echo '<a class="of-uploaded-image" href=" ' . esc_url ( $ img [0 ] ) . '"> ' ;
42
- echo '<img class="redux-option-image" id="image_ ' . esc_attr ( $ this ->field ['id ' ] ) . '_ ' . esc_attr ( $ attachment_id ) . '" src=" ' . esc_url ( $ img [0 ] ) . '" alt=" ' . esc_attr ( $ alt ) . '" target="_blank" rel="external" /> ' ;
43
- echo '</a> ' ;
42
+ echo '<a class="of-uploaded-image" href=" ' . esc_url ( $ img [0 ] ) . '"> ' ;
43
+ echo '<img class="redux-option-image" id="image_ ' . esc_attr ( $ this ->field ['id ' ] ) . '_ ' . esc_attr ( $ attachment_id ) . '" src=" ' . esc_url ( $ img [0 ] ) . '" alt=" ' . esc_attr ( $ alt ) . '" target="_blank" rel="external" /> ' ;
44
+ echo '</a> ' ;
45
+ }
44
46
}
45
47
}
46
48
You can’t perform that action at this time.
0 commit comments