/** * Conditionally add plugin features to analyse for video content */ public function __construct() { if (class_exists('Advanced_Responsive_Video_Embedder') && method_exists('Advanced_Responsive_Video_Embedder', 'get_instance')) { // Retrieve the enabled shortcodes the ARVE way $arve = Advanced_Responsive_Video_Embedder::get_instance(); $options = $arve->get_options(); // We don't support playlists unset($options['shortcodes']['dailymotionlist'], $options['shortcodes']['youtubelist']); foreach ($options['shortcodes'] as $provider => $shortcode) { $this->shortcodes[] = $provider; } $arve_embed_list = $arve->get_regex_list(); // We don't support playlists unset($arve_embed_list['dailymotionlist']); foreach ($arve_embed_list as $provider => $regex) { // Fix two service names $service = $provider; if ($service === 'youtu_be') { $service = 'youtube'; } elseif ($service === 'dai_ly' || $service === 'dailymotion_hub') { $service = 'dailymotion'; } /* Add the embed keys Handler name => VideoSEO service name */ $this->video_autoembeds['arve_' . $provider] = $service; } } }
/** * Begins execution of the plugin. * * Since everything within the plugin is registered via hooks, * then kicking off the plugin from this point in the file does * not affect the page life cycle. * * @since 1.0.0 */ function run_advanced_responsive_video_embedder() { $plugin = new Advanced_Responsive_Video_Embedder(); $plugin->run(); }