Skip to content

Commit 884e808

Browse files
committed
Apply breakpoints only if the id exists; Rmove translation from debug log text
1 parent 6097cf8 commit 884e808

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

php/delivery/class-responsive-breakpoints.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,10 @@ public function add_features( $tag_element ) {
127127
* @return array
128128
*/
129129
protected function apply_breakpoints( $tag_element ) {
130+
if ( ! $tag_element['id'] ) {
131+
return $tag_element;
132+
}
133+
130134
$settings = $this->settings->get_value( 'media_display' );
131135
$max = $settings['max_width'];
132136
$min = $settings['min_width'];
@@ -135,8 +139,7 @@ protected function apply_breakpoints( $tag_element ) {
135139
$debug_key = 'responsive_breakpoints_' . $tag_element['id'];
136140

137141
if ( ! $width || ! $height ) {
138-
// Translators: %s is the ID of the image missing width or height.
139-
Utils::log( sprintf( __( 'Missing width or height for image: %s', 'cloudinary' ), $tag_element['id'] ), $debug_key );
142+
Utils::log( 'Missing width or height for image with ID: ' . $tag_element['id'], $debug_key );
140143
return $tag_element;
141144
}
142145

0 commit comments

Comments
 (0)