WordPress.org

Make WordPress Core

Ticket #31373: 31373-dailymotion.diff

File 31373-dailymotion.diff, 871 bytes (added by stephdau, 5 years ago)

Adds DailyMotion embed detection in non-DailyMotion pages (as we do for others). Will discover DM embeds on any site/page.

  • src/wp-admin/includes/class-wp-press-this.php

     
    419419                        $src = 'https://vimeo.com/' . (int) $src_matches[1];
    420420                } else if ( preg_match( '/\/\/vine\.co\/v\/([^\/]+)\/embed/', $src, $src_matches ) ) {
    421421                        $src = 'https://vine.co/v/' . $src_matches[1];
     422                } else if ( preg_match( '/\/\/(www\.)?dailymotion\.com\/embed\/video\/([^\/\?]+)([\/\?]{1}.+)?/', $src, $src_matches ) ) {
     423                        $src = 'https://www.dailymotion.com/video/' . $src_matches[2];
    422424                } else if ( ! preg_match( '/\/\/(m\.|www\.)?youtube\.com\/watch\?/', $src )
    423425                            && ! preg_match( '/\/youtu\.be\/.+$/', $src )
    424426                            && ! preg_match( '/\/\/vimeo\.com\/[\d]+$/', $src )