1387 | | $video = $url; |
1388 | | if ( shortcode_exists( 'video' ) ) { |
1389 | | if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) { |
1390 | | $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] ); |
1391 | | $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] ); |
1392 | | } elseif ( strstr( $url, home_url() ) ) { |
1393 | | $id = attachment_url_to_postid( $url ); |
1394 | | if ( ! empty( $id ) ) { |
1395 | | $meta = wp_get_attachment_metadata( $id ); |
1396 | | if ( ! empty( $meta['width'] ) ) |
1397 | | $dimensions .= sprintf( 'width="%d" ', (int) $meta['width'] ); |
1398 | | if ( ! empty( $meta['height'] ) ) |
1399 | | $dimensions .= sprintf( 'height="%d" ', (int) $meta['height'] ); |
1400 | | } |
| 1385 | if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) { |
| 1386 | $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] ); |
| 1387 | $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] ); |
| 1388 | } elseif ( strstr( $url, home_url() ) ) { |
| 1389 | $id = attachment_url_to_postid( $url ); |
| 1390 | if ( ! empty( $id ) ) { |
| 1391 | $meta = wp_get_attachment_metadata( $id ); |
| 1392 | if ( ! empty( $meta['width'] ) ) |
| 1393 | $dimensions .= sprintf( 'width="%d" ', (int) $meta['width'] ); |
| 1394 | if ( ! empty( $meta['height'] ) ) |
| 1395 | $dimensions .= sprintf( 'height="%d" ', (int) $meta['height'] ); |