diff --git a/class.media-summary.php b/class.media-summary.php index 0bd9a35835f74..acbe0b9ba0572 100644 --- a/class.media-summary.php +++ b/class.media-summary.php @@ -99,7 +99,7 @@ static function get( $post_id, $blog_id = 0, $args = array() ) { if ( !empty( $extract['has']['embed'] ) ) { foreach( $extract['embed']['url'] as $embed ) { - if ( preg_match( '/((youtube|vimeo)\.com|youtu.be)/', $embed ) ) { + if ( preg_match( '/((youtube|vimeo|dailymotion)\.com|youtu.be)/', $embed ) ) { if ( 0 == $return['count']['video'] ) { $return['type'] = 'video'; $return['video'] = 'http://' . $embed; @@ -120,6 +120,10 @@ static function get( $post_id, $blog_id = 0, $args = array() ) { $poster_url_parts = parse_url( $poster_image ); $return['secure']['image'] = 'https://secure-a.vimeocdn.com' . $poster_url_parts['path']; } + } else if ( false !== strpos( $embed, 'dailymotion' ) ) { + $return['image'] = str_replace( 'dailymotion.com/video/','dailymotion.com/thumbnail/video/', $embed ); + $return['image'] = parse_url( $return['image'], PHP_URL_SCHEME ) === null ? 'http://' . $return['image'] : $return['image']; + $return['secure']['image'] = self::https( $return['image'] ); } }