diff --git a/embed.php b/embed.php index f3d44c56d47060d425c2227a13e3f7f98e20d2a0..0dc8b2dc8815fa7077a358a8b435bc22a19d7259 100644 --- a/embed.php +++ b/embed.php @@ -9,8 +9,8 @@ **/ function wp_embed_handler_google_maps( $matches, $attr, $url, $rawattr ) { - $width = ($rawattr['width']) ? $rawattr['width'] : 425 ; - $height = ($rawattr['height']) ? $rawattr['height'] : 350 ; + $width = $rawattr['width'] ?? 425 ; + $height = $rawattr['height'] ?? 350 ; $query = add_query_arg(array('output' => 'embed'), $matches[0]); $embed = '<iframe width="'.esc_attr($width).'" height="'.esc_attr($height).'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.esc_attr($query).'"></iframe>'; @@ -18,8 +18,8 @@ function wp_embed_handler_google_maps( $matches, $attr, $url, $rawattr ) { } function wp_embed_handler_openstreetmap( $matches, $attr, $url, $rawattr ) { - $width = ($rawattr['width']) ? $rawattr['width'] : 425 ; - $height = ($rawattr['height']) ? $rawattr['height'] : 350 ; + $width = $rawattr['width'] ?? 425 ; + $height = $rawattr['height'] ?? 350 ; $embed = '<iframe width="'.esc_attr($width).'" height="'.esc_attr($height).'" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="'.esc_attr($matches[0]).'"></iframe>'; return apply_filters( 'embed_openstreetmap', $embed, $matches, $attr, $url, $rawattr ); @@ -59,8 +59,8 @@ function wp_embed_handler_archive( $matches, $attr, $url, $rawattr ) { } function wp_embed_handler_dctptv( $matches, $attr, $url, $rawattr ) { -$width = ($attr['width']) ? $attr['width'] : 480 ; -$height = ($attr['height']) ? $attr['height'] : 396 ; +$width = $attr['width'] ?? 480 ; +$height = $attr['height'] ?? 396 ; $embed= sprintf( '<iframe width="%3$s" scrolling="no" height="%2$s" frameborder="0" src="%1$s" name="dctp-embed" marginwidth="0" marginheight="0"><br> </iframe>',esc_attr($matches[0]),esc_attr($height),esc_attr($width));