本文整理汇总了PHP中wp_oembed_add_provider函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_oembed_add_provider函数的具体用法?PHP wp_oembed_add_provider怎么用?PHP wp_oembed_add_provider使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_oembed_add_provider函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: iweb_register_additional_oembed_providers
/**
* Register additional oEmbed providers
*
* @author Syed Balkhi
* @link http://goo.gl/tccJh
*/
function iweb_register_additional_oembed_providers()
{
wp_oembed_add_provider('http://www.mixcloud.com/*', 'http://www.mixcloud.com/oembed');
}
开发者ID:meowrika,项目名称:govintranet,代码行数:10,代码来源:functions.php
示例2: instagram_oembed_provider
function instagram_oembed_provider()
{
wp_oembed_add_provider('#https?://(www.)?instagram.com/p/.*#i', 'http://api.instagram.com/oembed', true);
wp_oembed_add_provider('#https?://(www.)?instagr.am/p/.*#i', 'http://api.instagram.com/oembed', true);
}
开发者ID:plowzzer,项目名称:PL-portfolio,代码行数:5,代码来源:functions.php
示例3: wp_estate_init
function wp_estate_init()
{
global $content_width;
if (!isset($content_width)) {
$content_width = 1800;
}
load_theme_textdomain('wpestate', get_template_directory() . '/languages');
set_post_thumbnail_size(940, 198, true);
add_editor_style();
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_theme_support('custom-background');
add_theme_support("title-tag");
wp_estate_setup();
add_action('widgets_init', 'register_wpestate_widgets');
add_action('init', 'wpestate_shortcodes');
wp_oembed_add_provider('#https?://twitter.com/\\#!/[a-z0-9_]{1,20}/status/\\d+#i', 'https://api.twitter.com/1/statuses/oembed.json', true);
wpestate_image_size();
add_filter('excerpt_length', 'wp_estate_excerpt_length');
add_filter('excerpt_more', 'wpestate_new_excerpt_more');
add_action('tgmpa_register', 'wpestate_required_plugins');
add_action('wp_enqueue_scripts', 'wpestate_scripts');
// function in css_js_include.php
add_action('admin_enqueue_scripts', 'wpestate_admin');
// function in css_js_include.php
}
开发者ID:riddya85,项目名称:rentail_upwrk,代码行数:26,代码来源:functions_1.php
示例4: add_facebook
/**
* Register Facebook provider
*
* @since 1.0.0
* @param array $providers Existing providers.
*/
public function add_facebook($providers)
{
$endpoints = array('#https?://www\\.facebook\\.com/video.php.*#i' => 'https://www.facebook.com/plugins/video/oembed.json/', '#https?://www\\.facebook\\.com/.*/videos/.*#i' => 'https://www.facebook.com/plugins/video/oembed.json/', '#https?://www\\.facebook\\.com/.*/posts/.*#i' => 'https://www.facebook.com/plugins/post/oembed.json/', '#https?://www\\.facebook\\.com/.*/activity/.*#i' => 'https://www.facebook.com/plugins/post/oembed.json/', '#https?://www\\.facebook\\.com/photo(s/|.php).*#i' => 'https://www.facebook.com/plugins/post/oembed.json/', '#https?://www\\.facebook\\.com/permalink.php.*#i' => 'https://www.facebook.com/plugins/post/oembed.json/', '#https?://www\\.facebook\\.com/media/.*#i' => 'https://www.facebook.com/plugins/post/oembed.json/', '#https?://www\\.facebook\\.com/questions/.*#i' => 'https://www.facebook.com/plugins/post/oembed.json/', '#https?://www\\.facebook\\.com/notes/.*#i' => 'https://www.facebook.com/plugins/post/oembed.json/');
foreach ($endpoints as $pattern => $endpoint) {
wp_oembed_add_provider($pattern, $endpoint, true);
}
}
开发者ID:CherryFramework,项目名称:cherry-framework,代码行数:13,代码来源:class-cherry-facebook-embed.php
示例5: register_oembed
/**
* Register the two URLS that support will be created for
*
* @author Nate Jacobs
* @date 3/9/13
* @since 1.0
*/
public function register_oembed()
{
$oembed_url = home_url();
$key = $this->get_key();
// Create our own oembed url
$oembed_url = add_query_arg(array('brickset_oembed' => $key), $oembed_url);
wp_oembed_add_provider('#https?://(www\\.)?brickset.com/detail/\\?Set\\=.*/?#i', $oembed_url, true);
wp_oembed_add_provider('#https?://(www\\.)?brickset.com/browse/themes/\\?theme\\=.*/?#i', $oembed_url, true);
}
开发者ID:pedro-mendonca,项目名称:Brickset-API,代码行数:16,代码来源:class-oembed.php
示例6: init
/**
* Attach handlers for Vine embeds
*
* @since 1.0.0
*
* @return void
*/
public static function init()
{
// register our shortcode and its handler
add_shortcode(self::SHORTCODE_TAG, array(__CLASS__, 'shortcodeHandler'));
// register a preferred handler for the Vine URL pattern
// matched URLs execute before the oEmbed handlers
wp_embed_register_handler(self::SHORTCODE_TAG, self::URL_PATTERN, array(__CLASS__, 'linkHandler'), 1);
// add Vine to the list of allowed oEmbed providers
// fallback for functions that go straight to oEmbed
wp_oembed_add_provider(self::URL_PATTERN, 'https://vine.co/oembed.{format}', true);
}
开发者ID:StudentLifeMarketingAndDesign,项目名称:krui-wp,代码行数:18,代码来源:Vine.php
示例7: register_dc_oembed_provider
function register_dc_oembed_provider()
{
/*
Hello developer. If you wish to test this plugin against your
local installation of DocumentCloud (with its own testing
domain), set the OEMBED_PROVIDER and OEMBED_RESOURCE_DOMAIN
constants above to your local testing domain. You'll also want
to uncomment the next line to let WordPress connect to local
domains.
*/
// add_filter( 'http_request_host_is_external', '__return_true');
wp_oembed_add_provider("http://" . WP_DocumentCloud::OEMBED_RESOURCE_DOMAIN . "/documents/*", WP_DocumentCloud::OEMBED_PROVIDER);
wp_oembed_add_provider("https://" . WP_DocumentCloud::OEMBED_RESOURCE_DOMAIN . "/documents/*", WP_DocumentCloud::OEMBED_PROVIDER);
}
开发者ID:eyeseast,项目名称:wordpress-documentcloud,代码行数:14,代码来源:documentcloud.php
示例8: magyar_video_embed
function magyar_video_embed()
{
wp_embed_unregister_handler('vivatvhu');
wp_embed_unregister_handler('mtvcohu');
wp_embed_unregister_handler('mnohu');
wp_embed_unregister_handler('tv2hu');
wp_embed_unregister_handler('rtlhu');
wp_embed_register_handler('vivatvhu', '#http://(www\\.)?vivatv\\.hu/([0-9a-zA-Z\\-\\_\\/]+)/(?:videos)/([0-9a-zA-Z\\-\\_\\/]+)\\-([\\d]+)#i', 'wp_embed_handler_vivatvhu');
wp_embed_register_handler('mtvcohu', '#http://(www\\.)?mtv\\.co\\.hu/([0-9a-zA-Z\\-\\_\\/]+)/(?:videos)/([0-9a-zA-Z\\-\\_\\/]+)\\-([\\d]+)#i', 'wp_embed_handler_mtvcohu');
wp_embed_register_handler('mnohu', '#http://(www\\.)?mno\\.hu/(?:videok)/([\\d]+)#i', 'wp_embed_handler_mnohu');
wp_embed_register_handler('tv2hu', '#http://(www\\.)?tv2\\.hu/(musoraink)/([0-9a-zA-Z\\.\\-\\_]+)/([\\d]+)_([0-9a-zA-Z\\.\\-\\_]+)#i', 'wp_embed_handler_tv2hu');
wp_embed_register_handler('rtlhu', '#http://(www\\.)?rtl\\.hu/(rtlklub)/([0-9a-zA-Z\\-\\_\\/]+)#i', 'wp_embed_handler_rtlhu');
wp_oembed_add_provider('#http://(www\\.)?noltv\\.hu/video/([\\d]+)\\.html#i', 'http://www.noltv.hu/services/oembed', true);
wp_oembed_add_provider('#http://(www\\.)?indavideo\\.hu/video/(.*)#i', 'http://www.indavideo.hu/oembed', true);
wp_oembed_add_provider('#http://(www\\.)?videa\\.hu/videok/(.*)#i', 'http://videa.hu/oembed', true);
wp_oembed_add_provider('#http://(www\\.)?pixter\\.hu/video\\?id=(.*)#i', 'http://www.pixter.hu/oembed.{format}', true);
}
开发者ID:AniPalace,项目名称:FansubPress,代码行数:17,代码来源:magyar-video-embed.php
示例9: marcatoxml_plugin
function marcatoxml_plugin()
{
$this->importer = new marcatoxml_importer();
add_action('admin_menu', array($this, 'build_menus'));
add_filter('posts_where', array($this, 'posts_where'));
add_action('init', array($this, 'register_custom_post_types'));
add_action('init', array($this, 'enqueue_styles'));
register_activation_hook(__FILE__, array($this, 'flush_rewrites'));
register_deactivation_hook(__FILE__, array($this, 'flush_rewrites'));
register_activation_hook(__FILE__, array($this, 'schedule_updates'));
register_deactivation_hook(__FILE__, array($this, 'unschedule_updates'));
add_action('marcato_update', array($this, 'cron_job'));
add_filter('pre_get_posts', array($this, 'query_post_type'));
add_filter('mce_css', array($this, 'add_mce_css'));
add_shortcode('marcato-link', array($this, 'marcato_link'));
add_shortcode('marcato-field', array($this, 'marcato_field'));
add_shortcode('marcato-thumbnail', array($this, 'marcato_thumbnail'));
wp_oembed_add_provider('#http://(www\\.)?soundcloud.com/.*#i', 'http://www.soundcloud.com/oembed/', true);
}
开发者ID:jamiemitchell,项目名称:marcato_festival_wordpress_plugin,代码行数:19,代码来源:marcatoxml.php
示例10: add_oembed
/**
* Adds oembed endpoints for supported video platforms that are not supported by core.
*
* @since 1.3.5
*/
public function add_oembed()
{
// @todo - check with official plugin
// Wistia
$options = get_option('wpseo_video');
$wistia_regex = '`(?:http[s]?:)?//[^/]*(wistia\\.(com|net)|wi\\.st#CUSTOM_URL#)/(medias|embed)/.*`i';
if ($options['wistia_domain'] !== '') {
$wistia_regex = str_replace('#CUSTOM_URL#', '|' . preg_quote($options['wistia_domain'], '`'), $wistia_regex);
} else {
$wistia_regex = str_replace('#CUSTOM_URL#', '', $wistia_regex);
}
wp_oembed_add_provider($wistia_regex, 'http://fast.wistia.com/oembed', true);
// Animoto, Ted, Collegehumor - WP native support added in WP 4.0
if (version_compare($GLOBALS['wp_version'], '3.9.99', '<')) {
wp_oembed_add_provider('`http[s]?://(?:www\\.)?(animoto|video214)\\.com/play/.*`i', 'http://animoto.com/oembeds/create', true);
wp_oembed_add_provider('`http[s]?://(www\\.)?collegehumor\\.com/video/.*`i', 'http://www.collegehumor.com/oembed.{format}', true);
wp_oembed_add_provider('`http[s]?://(www\\.|embed\\.)?ted\\.com/talks/.*`i', 'http://www.ted.com/talks/oembed.{format}', true);
} else {
wp_oembed_add_provider('`http[s]?://(?:www\\.)?viddler\\.com/.*`i', 'http://lab.viddler.com/services/oembed/', true);
}
// Screenr
wp_oembed_add_provider('`http[s]?://(?:www\\.)?screenr\\.com/.*`i', 'http://www.screenr.com/api/oembed.{format}', true);
// EVS
$evs_location = get_option('evs_location');
if ($evs_location && !empty($evs_location)) {
wp_oembed_add_provider($evs_location . '/*', $evs_location . '/oembed.php', false);
}
}
开发者ID:bitrecruiter,项目名称:wordpress-stackable,代码行数:33,代码来源:video-seo.php
示例11: novalite_oembed_soundcloud
function novalite_oembed_soundcloud()
{
wp_oembed_add_provider('http://soundcloud.com/*', 'http://soundcloud.com/oembed');
wp_oembed_add_provider('https://soundcloud.com/*', 'http://soundcloud.com/oembed');
wp_oembed_add_provider('#https?://(?:api\\.)?soundcloud\\.com/.*#i', 'http://soundcloud.com/oembed');
}
开发者ID:pbhanu1994,项目名称:bhanuprakash,代码行数:6,代码来源:main.php
示例12: extra_oembed_providers
/**
* Add any extra oEmbed providers that we know about and use on wpcom for feature parity.
*/
function extra_oembed_providers()
{
// Cloudup: https://dev.cloudup.com/#oembed
wp_oembed_add_provider('https://cloudup.com/*', 'https://cloudup.com/oembed');
wp_oembed_add_provider('https://me.sh/*', 'https://me.sh/oembed?format=json');
wp_oembed_add_provider('#https?://(www\\.)?gfycat\\.com/.*#i', 'https://api.gfycat.com/v1/oembed', true);
wp_oembed_add_provider('#https?://[^.]+\\.(wistia\\.com|wi\\.st)/(medias|embed)/.*#', 'https://fast.wistia.com/oembed', true);
wp_oembed_add_provider('#https?://sketchfab\\.com/.*#i', 'https://sketchfab.com/oembed', true);
}
开发者ID:jordankoschei,项目名称:jordankoschei-dot-com,代码行数:12,代码来源:class.jetpack.php
示例13: wpcom_force_ssl_home_urls_in_content_when_secure
}
}
function wpcom_force_ssl_home_urls_in_content_when_secure($content)
{
if (is_admin()) {
return $content;
}
if (is_ssl()) {
return str_replace(home_url('/', 'http'), home_url('/', 'https'), $content);
}
return str_replace(home_url('/', 'https'), home_url('/', 'http'), $content);
}
add_filter('the_content', 'wpcom_force_ssl_home_urls_in_content_when_secure');
add_filter('comment_text', 'wpcom_force_ssl_home_urls_in_content_when_secure');
add_filter('widget_text', 'wpcom_force_ssl_home_urls_in_content_when_secure');
wp_oembed_add_provider('#https?://[^.]+\\.(wistia\\.com|wi\\.st)/(medias|embed)/.*#', 'https://fast.wistia.com/oembed', true);
/**
* Load a WordPress.com theme compat file, if it exists.
*/
function wpcom_load_theme_compat_file()
{
if (!defined('WP_INSTALLING') || 'wp-activate.php' === $GLOBALS['pagenow']) {
// Many wpcom.php files call $themecolors directly. Ease the pain.
global $themecolors;
$template_path = get_template_directory();
$stylesheet_path = get_stylesheet_directory();
$file = '/inc/wpcom.php';
// Look also in /includes as alternate location, since premium theme partners may use that convention.
if (!file_exists($template_path . $file) && !file_exists($stylesheet_path . $file)) {
$file = '/includes/wpcom.php';
}
开发者ID:drrobotnik,项目名称:vip-quickstart,代码行数:31,代码来源:wpcom.php
示例14: out
Original version: Johannes Wagener <[email protected]>
Options support: Tiffany Conroy <[email protected]>
HTML5 & oEmbed support: Tim Bormans <[email protected]>
*/
/*
A8C: Taken from http://plugins.svn.wordpress.org/soundcloud-shortcode/trunk/
at revision 664386.
Commenting out (instead of removing) and replacing code with custom modifs
so it's eqsy to see what differs from the standard DOTORG version.
All custom modifs are annoted with "A8C" keyword in comment.
*/
/* Register oEmbed provider
-------------------------------------------------------------------------- */
wp_oembed_add_provider('#https?://(?:api\\.)?soundcloud\\.com/.*#i', 'http://soundcloud.com/oembed', true);
/* Register SoundCloud shortcode
-------------------------------------------------------------------------- */
add_shortcode("soundcloud", "soundcloud");
/**
* SoundCloud shortcode handler
* @param {string|array} $atts The attributes passed to the shortcode like [soundcloud attr1="value" /].
* Is an empty string when no arguments are given.
* @param {string} $content The content between non-self closing [soundcloud]…[/soundcloud] tags.
* @return {string} Widget embed code HTML
*/
function soundcloud($atts, $content = null)
{
// Custom shortcode options
$shortcode_options = array_merge(array('url' => trim($content)), is_array($atts) ? $atts : array());
// Turn shortcode option "param" (param=value¶m2=value) into array
开发者ID:EmreKarahan,项目名称:wordpress,代码行数:31,代码来源:soundcloud.php
示例15: add_embedly_providers
/**
* Does the work of adding the Embedly providers to wp_oembed
*/
function add_embedly_providers($the_content)
{
$services = get_embedly_selected_services();
$embedly_key = get_option('embedly_key');
require_once ABSPATH . WPINC . '/class-oembed.php';
$oembed = _wp_oembed_get_object();
$oembed->providers = array();
if ($services && get_option('embedly_active')) {
foreach ($services as $service) {
foreach (json_decode($service->regex) as $sre) {
if ($embedly_key) {
wp_oembed_add_provider($sre, 'http://api.embed.ly/1/oembed?key=' . $embedly_key, true);
} else {
wp_oembed_add_provider($sre, 'http://api.embed.ly/1/oembed', true);
}
}
}
}
}
开发者ID:r-a-y,项目名称:embedly_wordpress_plugin,代码行数:22,代码来源:embedly.php
示例16: wp_oembed_remove_provider
<?php
// guarantee use of https
wp_oembed_remove_provider('#https?://(www\\.)?slideshare\\.net/.*#i');
wp_oembed_add_provider('#https?://(www\\.)?slideshare\\.net/.*#i', 'https://www.slideshare.net/api/oembed/2', true);
/*
* Slideshare shortcode format:
* Old style (still compatible): [slideshare id=5342235&doc=camprock-101002163655-phpapp01&w=300&h=200]
* New style: [slideshare id=5342235&w=300&h=200&fb=0&mw=0&mh=0&sc=no]
*
* Legend:
* id = Document ID provided by Slideshare
* w = Width of iFrame (int)
* h = Height of iFrame (int)
* fb = iFrame frameborder (int)
* mw = iFrame marginwidth (int)
* mh = iFrame marginheight (int)
* sc = iFrame Scrollbar (yes/no)
**/
add_shortcode('slideshare', 'slideshare_shortcode');
function slideshare_shortcode($atts)
{
global $content_width;
$params = shortcode_new_to_old_params($atts);
parse_str($params, $arguments);
if (empty($arguments)) {
return '<!-- SlideShare error: no arguments -->';
}
extract($arguments);
// check that the Slideshare ID contains letters, numbers and query strings
$pattern = '/[^-_a-zA-Z0-9?=&]/';
开发者ID:StefanBonilla,项目名称:CoupSoup,代码行数:31,代码来源:slideshare.php
示例17: subscription_email_mesh
<?php
// Nicer Mesh email subscription output
function subscription_email_mesh($existing)
{
$existing[] = array('regex' => '@<div style=".*?" class="mesh-embed">\\s*<div style="padding-top: 100%"></div>\\s*(?:<p>)<iframe src="(https://me\\.sh.*?)".*?</iframe>\\s*</div>@', 'endpoint' => 'https://me.sh/oembed');
return $existing;
}
add_filter('subscription_email_oembeds', 'subscription_email_mesh');
wp_oembed_add_provider('#https?://me.sh/.*#i', 'https://me.sh/oembed?format=json', true);
开发者ID:walkthenight,项目名称:walkthenight-wordpress,代码行数:10,代码来源:mesh.php
示例18: add_oembed_provider
/**
* Add this site to the whitelist of oEmbed providers.
*/
public function add_oembed_provider()
{
wp_oembed_add_provider(home_url('/*'), esc_url(rest_url('wp/v2/oembed')));
}
开发者ID:pfefferle,项目名称:oEmbed-API,代码行数:7,代码来源:plugin.php
示例19: add_oembed_soundcloud
function add_oembed_soundcloud()
{
wp_oembed_add_provider('http://soundcloud.com/*', 'http://api.soundcloud.com/');
}
开发者ID:rauleonel,项目名称:soncursos,代码行数:4,代码来源:functions.php
示例20: addVimeoOembedCorrectly
public function addVimeoOembedCorrectly()
{
wp_oembed_add_provider('#http://(www\\.)?vimeo\\.com/.*#i', 'http://vimeo.com/api/oembed.{format}', true);
}
开发者ID:shubham79,项目名称:Jhintaak,代码行数:4,代码来源:framework.php
注:本文中的wp_oembed_add_provider函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论