Skip to content
Snippets Groups Projects
Commit 218bb195 authored by lucha's avatar lucha
Browse files

embed.php: use modern PHP ?? operator

parent ce2a6f32
No related branches found
No related tags found
No related merge requests found
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
**/ **/
function wp_embed_handler_google_maps( $matches, $attr, $url, $rawattr ) { function wp_embed_handler_google_maps( $matches, $attr, $url, $rawattr ) {
$width = ($rawattr['width']) ? $rawattr['width'] : 425 ; $width = $rawattr['width'] ?? 425 ;
$height = ($rawattr['height']) ? $rawattr['height'] : 350 ; $height = $rawattr['height'] ?? 350 ;
$query = add_query_arg(array('output' => 'embed'), $matches[0]); $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>'; $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 ) { ...@@ -18,8 +18,8 @@ function wp_embed_handler_google_maps( $matches, $attr, $url, $rawattr ) {
} }
function wp_embed_handler_openstreetmap( $matches, $attr, $url, $rawattr ) { function wp_embed_handler_openstreetmap( $matches, $attr, $url, $rawattr ) {
$width = ($rawattr['width']) ? $rawattr['width'] : 425 ; $width = $rawattr['width'] ?? 425 ;
$height = ($rawattr['height']) ? $rawattr['height'] : 350 ; $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>'; $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 ); return apply_filters( 'embed_openstreetmap', $embed, $matches, $attr, $url, $rawattr );
...@@ -59,8 +59,8 @@ function wp_embed_handler_archive( $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 ) { function wp_embed_handler_dctptv( $matches, $attr, $url, $rawattr ) {
$width = ($attr['width']) ? $attr['width'] : 480 ; $width = $attr['width'] ?? 480 ;
$height = ($attr['height']) ? $attr['height'] : 396 ; $height = $attr['height'] ?? 396 ;
$embed= sprintf( $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 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)); </iframe>',esc_attr($matches[0]),esc_attr($height),esc_attr($width));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment