File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -127,12 +127,22 @@ public function add_features( $tag_element ) {
127127 * @return array
128128 */
129129 protected function apply_breakpoints ( $ tag_element ) {
130+ if ( empty ( $ tag_element ['id ' ] ) ) {
131+ return $ tag_element ;
132+ }
133+
134+ $ settings = $ this ->settings ->get_value ( 'media_display ' );
135+ $ max = $ settings ['max_width ' ];
136+ $ min = $ settings ['min_width ' ];
137+ $ width = (int ) $ tag_element ['width ' ];
138+ $ height = (int ) $ tag_element ['height ' ];
139+ $ debug_key = 'responsive_breakpoints_ ' . $ tag_element ['id ' ];
140+
141+ if ( ! $ width || ! $ height ) {
142+ Utils::log ( 'Missing width or height for image with ID: ' . $ tag_element ['id ' ], $ debug_key );
143+ return $ tag_element ;
144+ }
130145
131- $ settings = $ this ->settings ->get_value ( 'media_display ' );
132- $ max = $ settings ['max_width ' ];
133- $ min = $ settings ['min_width ' ];
134- $ width = $ tag_element ['width ' ];
135- $ height = $ tag_element ['height ' ];
136146 $ size_tag = '- ' . $ width . 'x ' . $ height . '. ' ;
137147 $ step = $ settings ['pixel_step ' ];
138148 $ ratio = $ width / $ height ;
You can’t perform that action at this time.
0 commit comments