Elementor的视频小部件

时间:2019-05-10 08:02:09

标签: php widget elementor

我想向elementor小部件添加另一个小部件。

带有https://aparat.com

的视频小部件

“ $ provider_match_masks”我应该在哪里卡住?

班级嵌入{

/**
 * Provider match masks.
 *
 * Holds a list of supported providers with their URL structure in a regex format.
 *
 * @since 1.5.0
 * @access private
 * @static
 *
 * @var array Provider URL structure regex.
 */
private static $provider_match_masks = [
    'youtube' => '/^.*(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?:(?:watch)?\?(?:.*&)?vi?=|(?:embed|v|vi|user)\/))([^\?&\"\'>]+)/',
    'vimeo' => '/^.*vimeo\.com\/(?:[a-z]*\/)*([‌​0-9]{6,11})[?]?.*/',
    'dailymotion' => '/^.*dailymotion.com\/(?:video|hub)\/([^_]+)[^#]*(#video=([^_&]+))?/',
    'aparat' => '......',
];

/**
 * Embed patterns.
 *
 * Holds a list of supported providers with their embed patters.
 *
 * @since 1.5.0
 * @access private
 * @static
 *
 * @var array Embed patters.
 */
private static $embed_patterns = [
    'youtube' => 'https://www.youtube{NO_COOKIE}.com/embed/{VIDEO_ID}?feature=oembed',
    'vimeo' => 'https://player.vimeo.com/video/{VIDEO_ID}#t={TIME}',
    'dailymotion' => 'https://dailymotion.com/embed/video/{VIDEO_ID}',
    'aparat' => 'https://aparat.com/video/video/embed/videohash/{VIDEO_ID}/vt/frame',
];

0 个答案:

没有答案