File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -128,12 +128,21 @@ public function render_callback( $attributes, $content ) {
128128 'refresh ' => '12_hours ' ,
129129 );
130130
131- $ query = isset ( $ attributes ['query ' ] ) ? wp_parse_args ( $ attributes ['query ' ], $ default_query ) : $ default_query ;
132- $ filters = isset ( $ attributes ['conditions ' ] ) ? $ attributes ['conditions ' ] : array ();
133- $ thumb = 'auto ' ;
131+ $ query = isset ( $ attributes ['query ' ] ) ? wp_parse_args ( $ attributes ['query ' ], $ default_query ) : $ default_query ;
132+ $ filters = isset ( $ attributes ['conditions ' ] ) ? $ attributes ['conditions ' ] : array ();
133+ $ thumb = 'auto ' ;
134+ $ default_thumbnail = '' ;
134135
135136 if ( isset ( $ attributes ['thumb ' ] ) && ! empty ( $ attributes ['thumb ' ] ) ) {
136137 $ thumb = $ attributes ['thumb ' ];
138+
139+ if (
140+ 'yes ' === $ thumb &&
141+ isset ( $ attributes ['fallbackImage ' ], $ attributes ['fallbackImage ' ]['url ' ] ) &&
142+ ! empty ( $ attributes ['fallbackImage ' ]['url ' ] )
143+ ) {
144+ $ default_thumbnail = $ attributes ['fallbackImage ' ]['url ' ];
145+ }
137146 }
138147
139148 $ options = array (
@@ -145,7 +154,7 @@ public function render_callback( $attributes, $content ) {
145154 'keywords_ban ' => '' ,
146155 'columns ' => '1 ' ,
147156 'thumb ' => $ thumb ,
148- 'default ' => '' ,
157+ 'default ' => $ default_thumbnail ,
149158 'title ' => '' ,
150159 'meta ' => 'yes ' ,
151160 'multiple_meta ' => 'no ' ,
You can’t perform that action at this time.
0 commit comments