本文整理汇总了PHP中wp_embed_register_handler函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_embed_register_handler函数的具体用法?PHP wp_embed_register_handler怎么用?PHP wp_embed_register_handler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_embed_register_handler函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: _fix_facebook_embed
/**
* Fix the Facebook embed handling
*
*/
private function _fix_facebook_embed()
{
// All of these are registered in jetpack/modules/shortcodes/facebook.php
if (defined('JETPACK_FACEBOOK_EMBED_REGEX')) {
wp_embed_unregister_handler('facebook');
wp_embed_register_handler('facebook', JETPACK_FACEBOOK_EMBED_REGEX, array(__CLASS__, 'facebook_embed_handler'));
}
if (defined('JETPACK_FACEBOOK_ALTERNATE_EMBED_REGEX')) {
wp_embed_unregister_handler('facebook-alternate');
wp_embed_register_handler('facebook-alternate', JETPACK_FACEBOOK_ALTERNATE_EMBED_REGEX, array(__CLASS__, 'facebook_embed_handler'));
}
if (defined('JETPACK_FACEBOOK_PHOTO_EMBED_REGEX')) {
wp_embed_unregister_handler('facebook-photo');
wp_embed_register_handler('facebook-photo', JETPACK_FACEBOOK_PHOTO_EMBED_REGEX, array(__CLASS__, 'facebook_embed_handler'));
}
if (defined('JETPACK_FACEBOOK_PHOTO_ALTERNATE_EMBED_REGEX')) {
wp_embed_unregister_handler('facebook-alternate-photo');
wp_embed_register_handler('facebook-alternate-photo', JETPACK_FACEBOOK_PHOTO_ALTERNATE_EMBED_REGEX, array(__CLASS__, 'facebook_embed_handler'));
}
if (defined('JETPACK_FACEBOOK_VIDEO_EMBED_REGEX')) {
wp_embed_unregister_handler('facebook-video');
wp_embed_register_handler('facebook-video', JETPACK_FACEBOOK_VIDEO_EMBED_REGEX, array(__CLASS__, 'facebook_embed_handler'));
}
if (defined('JETPACK_FACEBOOK_VIDEO_ALTERNATE_EMBED_REGEX')) {
wp_embed_unregister_handler('facebook-alternate-video');
wp_embed_register_handler('facebook-alternate-video', JETPACK_FACEBOOK_VIDEO_ALTERNATE_EMBED_REGEX, array(__CLASS__, 'facebook_embed_handler'));
}
}
开发者ID:ActiveWebsite,项目名称:BoojPressPlugins,代码行数:32,代码来源:class-instant-articles-jetpack.php
示例2: plugins_loaded
public function plugins_loaded()
{
add_action('wp_head', array($this, 'wp_head'));
load_plugin_textdomain('oembed-gist', false, dirname(plugin_basename(__FILE__)) . '/languages');
wp_embed_register_handler('oe-gist', $this->get_gist_regex(), array($this, 'handler'));
add_shortcode($this->get_shortcode_tag(), array($this, 'shortcode'));
add_filter('jetpack_shortcodes_to_include', array($this, 'jetpack_shortcodes_to_include'));
}
开发者ID:shizhua,项目名称:oembed-gist,代码行数:8,代码来源:oembed-gist.php
示例3: init
/**
* Register shortcode macro and handler
*
* @since 1.3.0
*
* @return void
*/
public static function init()
{
add_shortcode(static::SHORTCODE_TAG, array(__CLASS__, 'shortcodeHandler'));
// pass a Periscope profile URL through the Periscope On Air shortcode handler
wp_embed_register_handler(self::SHORTCODE_TAG, static::PERISCOPE_PROFILE_URL_REGEX, array(__CLASS__, 'linkHandler'), 1);
// Shortcode UI, if supported
add_action('register_shortcode_ui', array(__CLASS__, 'shortcodeUI'), 5, 0);
}
开发者ID:cemoulto,项目名称:wordpress,代码行数:15,代码来源:PeriscopeOnAir.php
示例4: plugins_loaded
public function plugins_loaded()
{
add_action('wp_enqueue_scripts', array($this, 'enquene_script'));
add_action('wp_head', array($this, 'wp_head'));
load_plugin_textdomain('oembed-travis', false, plugins_url(implode(array('languages'), DIRECTORY_SEPARATOR), __FILE__));
wp_embed_register_handler('oembed-travis', $this->get_travis_url_regex(), array($this, 'handler'));
add_shortcode($this->get_shortcode_tag(), array($this, 'shortcode'));
}
开发者ID:kamataryo,项目名称:oembed-travis,代码行数:8,代码来源:oembed-travis.php
示例5: run
/**
* Set up the plugin.
*
* Adds a [gist] shortcode to do the bulk of the heavy lifting. An embed
* handler is registered to mimic oEmbed functionality, but it relies on
* the shortcode for processing.
*
* Supported formats:
*
* * Old link: https://gist.github.com/{{id}}#file_{{filename}}
* * Old link with username: https://gist.github.com/{{user}}/{{id}}#file_{{filename}}
* * New bookmark: https://gist.github.com/{{id}}#file-{{file_slug}}
* * New bookmark with username: https://gist.github.com/{{user}}/{{id}}#file-{{sanitized-filename}}
*
* @since 1.1.0
*/
public function run()
{
$oembed_pattern = '#https://gist\\.github\\.com/(?:.*/)?([a-z0-9]+)(?:\\#file([_-])(.*))?#i';
wp_embed_register_handler('gist', $oembed_pattern, array($this, 'wp_embed_handler'));
add_shortcode('gist', array($this, 'shortcode'));
add_action('init', array($this, 'style'), 15);
add_action('post_updated', array($this, 'delete_gist_transients'), 10, 3);
}
开发者ID:shizhua,项目名称:gistpress,代码行数:24,代码来源:class-gistpress.php
示例6: init
public static function init()
{
/**
* Add new handler
* provider
* e.g. <iframe src='https://fr.tuto.com/embed/preview/53781/' width='560' height='356' frameborder='0' scrolling='auto' allowfullscreen></iframe>
*/
wp_embed_register_handler('embed-tuto', apply_filters('tuto_oembed/regex', '#https?:\\/\\/fr\\.tuto\\.com\\/embed\\/preview\\/([\\d]+)\\/?#i'), array(__CLASS__, 'register_handler'));
}
开发者ID:TweetPressFr,项目名称:tuto-oembed-wp,代码行数:9,代码来源:tuto-oembed-wp.php
示例7: plugins_loaded
function plugins_loaded()
{
if (!defined('NPR_API_KEY_OPTION')) {
return;
}
// http://www.npr.org/2010/11/20/131472499/hours-so-early-holiday-shoppers-stay-up-late
wp_embed_register_handler('npr_api', '#http://www.npr.org/\\d{4}/\\d{1,2}/\\d{1,2}/(\\d{7,})/#i', array(&$this, 'embed_callback'));
add_action('save_post', array(&$this, 'save_post'), 10, 2);
}
开发者ID:appliaison,项目名称:WP-NPR-API,代码行数:9,代码来源:embed.php
示例8: init
/**
* Register shortcode macro and handler
*
* @since 1.0.0
*
* @return void
*/
public static function init()
{
$classname = get_called_class();
add_shortcode(static::SHORTCODE_TAG, array($classname, 'shortcodeHandler'));
// convert a URL into the shortcode equivalent
wp_embed_register_handler(static::SHORTCODE_TAG, static::URL_REGEX, array($classname, 'linkHandler'), 1);
// Shortcode UI, if supported
add_action('register_shortcode_ui', array($classname, 'shortcodeUI'), 5, 0);
}
开发者ID:cemoulto,项目名称:wordpress,代码行数:16,代码来源:Follow.php
示例9: test_autoembed_should_return_modified_content
public function test_autoembed_should_return_modified_content()
{
$handle = rand_str();
$regex = '#https?://example\\.com/embed/([^/]+)#i';
$callback = array($this, '_embed_handler_callback');
wp_embed_register_handler($handle, $regex, $callback);
$content = "\nhttp://example.com/embed/foo\n";
$actual = $GLOBALS['wp_embed']->autoembed($content);
wp_embed_unregister_handler($handle);
$this->assertEquals("\nEmbedded http://example.com/embed/foo\n", $actual);
}
开发者ID:atimmer,项目名称:wordpress-develop-mirror,代码行数:11,代码来源:WpEmbed.php
示例10: 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
示例11: addPlugin
public function addPlugin($plugin)
{
$reflClass = new \ReflectionClass($plugin);
if (!$this->getAnnotationReader()->getClassAnnotation($reflClass, 'Oow\\Plugin\\Annotations\\Plugin')) {
throw new \InvalidArgumentException("{$reflClass->getName()} does not have any Oow\\Plugin\\Annotations\\Plugin annotation instance");
}
foreach ($reflClass->getMethods() as $method) {
if ($method->isPublic()) {
foreach ($this->getAnnotationReader()->getMethodAnnotations($method) as $annot) {
if ($annot instanceof Annotations\Hook) {
$tag = $annot->tag;
$function_to_add = array($plugin, $method->getName());
$priority = $annot->priority;
$accepted_args = $method->getNumberOfParameters();
add_filter($tag, $function_to_add, $priority, $accepted_args);
} elseif ($annot instanceof Annotations\Settings) {
$this->addPlugin($plugin->{$method->getName()}());
} elseif ($annot instanceof Annotations\Shortcode) {
$tag = $annot->tag;
$func = array($plugin, $method->getName());
add_shortcode($tag, $func);
} elseif ($annot instanceof Annotations\AjaxResponse) {
$closure = function () use($plugin, $method, $annot) {
if (isset($_REQUEST['_wpnonce']) && !wp_verify_nonce($_REQUEST['_wpnonce'], $annot->action)) {
$response = false;
} else {
$response = $plugin->{$method->getName()}();
}
if ($annot->json) {
wp_send_json($response);
} else {
echo $response;
wp_die();
}
};
add_action('wp_ajax_' . $annot->action, $closure);
if ($annot->nopriv) {
add_action('wp_ajax_nopriv_' . $annot->action, $closure);
}
} elseif ($annot instanceof Annotations\Embed) {
$id = $annot->id;
$regex = $annot->regex;
$func = array($plugin, $method->getName());
$priority = $annot->priority;
wp_embed_register_handler($id, $regex, $func, $priority);
}
}
}
}
return $this;
}
开发者ID:akky,项目名称:auto-currency-converter,代码行数:51,代码来源:PluginManager.php
示例12: init
/**
* Register shortcode handlers
*
* @since 1.1.6
*
* @uses add_shortcode()
* @uses wp_embed_register_handler()
* @return void
*/
public static function init()
{
// expose social plugin markup using WordPress Shortcode API
add_shortcode('facebook_like_button', array('Facebook_Shortcodes', 'like_button'));
add_shortcode('facebook_send_button', array('Facebook_Shortcodes', 'send_button'));
add_shortcode('facebook_follow_button', array('Facebook_Shortcodes', 'follow_button'));
add_shortcode('facebook_embedded_post', array('Facebook_Shortcodes', 'embedded_post'));
// Convert a Facebook URL possibly representing a public post into Facebook embedded post markup
wp_embed_register_handler('facebook_embedded_post_vanity', '#^https?://www\\.facebook\\.com/([A-Za-z0-9\\.-]{2,50})/posts/([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
wp_embed_register_handler('facebook_embedded_post_no_vanity', '#^https?://www\\.facebook\\.com/permalink\\.php\\?story_fbid=([\\d]+)&id=([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
wp_embed_register_handler('facebook_embedded_post_activity', '#^https?://www\\.facebook\\.com/([A-Za-z0-9\\.-]{2,50})/activity/([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
wp_embed_register_handler('facebook_embedded_post_question', '#^https?://www\\.facebook\\.com/questions/([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
wp_embed_register_handler('facebook_embedded_post_photo', '#^https?://www\\.facebook\\.com/photo\\.php\\?fbid=([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
wp_embed_register_handler('facebook_embedded_post_video', '#^https?://www\\.facebook\\.com/photo\\.php\\?v=([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
wp_embed_register_handler('facebook_embedded_post_note', '#^https?://www\\.facebook\\.com/notes/([A-Za-z0-9\\.-]{2,50})/([^/]+)/([\\d]+)#i', array('Facebook_Shortcodes', 'wp_embed_handler_embedded_post'));
}
开发者ID:aim-web-projects,项目名称:kobe-chuoh,代码行数:25,代码来源:shortcodes.php
示例13: 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
示例14: __construct
public function __construct()
{
// Initialize private defaults.
$this->prefix = $this->shortcode . '_';
$this->dt_defaults = json_encode(array('dom' => "B<'clear'>lfrtip", 'buttons' => array('colvis', 'copy', 'csv', 'excel', 'pdf', 'print')));
$this->capabilities = array($this->prefix . 'query_sql_databases');
add_action('plugins_loaded', array($this, 'registerL10n'));
add_action('init', array($this, 'maybeFetchGvizDataSource'));
add_action('admin_init', array($this, 'registerSettings'));
add_action('admin_menu', array($this, 'registerAdminMenu'));
add_action('admin_head', array($this, 'doAdminHeadActions'));
add_action('admin_enqueue_scripts', array($this, 'addAdminScripts'));
add_action('admin_print_footer_scripts', array($this, 'addQuickTagButton'));
add_action('wp_enqueue_scripts', array($this, 'addFrontEndScripts'));
add_shortcode($this->shortcode, array($this, 'displayShortcode'));
wp_embed_register_handler($this->shortcode . 'spreadsheet', $this->gdoc_url_regex, array($this, 'oEmbedHandler'));
register_activation_hook(__FILE__, array($this, 'activate'));
}
开发者ID:jgadbois,项目名称:inline-gdocs-viewer,代码行数:18,代码来源:inline-gdocs-viewer.php
示例15: __construct
/**
* add filters
*/
public function __construct()
{
add_filter('wpv_multiwidget_tab_title', array(&$this, 'multiwidget_tab_title'), 10, 3);
add_action('wpv_multiwidget_single_title', array(&$this, 'multiwidget_single_title'), 10, 2);
add_filter('wpv_posts_widget_thumbnail_name', array(&$this, 'posts_widget_thumbnail_name'), 10, 2);
add_filter('wpv_posts_widget_img_size', array(&$this, 'posts_widget_img_size'), 10, 2);
add_filter('wpv_column_title', array(&$this, 'column_title'), 10, 2);
add_filter('excerpt_length', array(&$this, 'excerpt_length'));
add_filter('excerpt_more', array(&$this, 'excerpt_more'));
add_filter('wp_title', array(__CLASS__, 'wp_title'));
remove_filter('the_content', 'li_display_love_link', 100);
wp_embed_register_handler('wpv-swf', '#https?://[^\\s]+?.swf$#i', array(__CLASS__, 'embed_handler_swf'));
add_filter('pre_option_page_for_posts', create_function('$value', 'return 0;'));
add_filter('oembed_dataparse', array(&$this, 'oembed_dataparse'), 90, 3);
add_action('layerslider_ready', array(&$this, 'layerslider_ready'));
add_filter('nav_menu_css_class', array(__CLASS__, 'nav_menu_css_class'), 10, 3);
add_action('wpv_before_post_content', array(__CLASS__, 'single_sermon_media'));
add_action('wpv_body', array(__CLASS__, 'wpv_splash_screen'));
}
开发者ID:petrfaitl,项目名称:wordpress-event-theme,代码行数:22,代码来源:shortcode-overrides.php
示例16: __construct
public function __construct()
{
if (is_admin()) {
add_action('admin_menu', array($this, 'admin_menu'));
$this->edit = true;
}
$option = get_option('smartideo_option');
if (!empty($option)) {
$option = json_decode($option, true);
} else {
$option = array();
}
$this->option = $option;
extract($option);
if (!empty($strategy)) {
$this->strategy = $strategy;
}
if ($this->strategy != 1) {
add_action('wp_enqueue_scripts', array($this, 'smartideo_scripts'));
}
wp_embed_unregister_handler('youku');
wp_embed_unregister_handler('tudou');
wp_embed_unregister_handler('56com');
wp_embed_unregister_handler('youtube');
// video
wp_embed_register_handler('smartideo_tudou', '#https?://(?:www\\.)?tudou\\.com/(?:programs/view|listplay/(?<list_id>[a-z0-9_=\\-]+))/(?<video_id>[a-z0-9_=\\-]+)/#i', array($this, 'smartideo_embed_handler_tudou'));
wp_embed_register_handler('smartideo_56', '#https?://(?:www\\.)?56\\.com/[a-z0-9]+/(?:play_album\\-aid\\-[0-9]+_vid\\-(?<video_id1>[a-z0-9_=\\-]+)|v_(?<video_id2>[a-z0-9_=\\-]+))#i', array($this, 'smartideo_embed_handler_56'));
wp_embed_register_handler('smartideo_youku', '#https?://v\\.youku\\.com/v_show/id_(?<video_id>[a-z0-9_=\\-]+)#i', array($this, 'smartideo_embed_handler_youku'));
wp_embed_register_handler('smartideo_qq', '#https?://v\\.qq\\.com/(?:[a-z0-9_\\./]+\\?vid=(?<video_id1>[a-z0-9_=\\-]+)|(?:[a-z0-9/]+)/(?<video_id2>[a-z0-9_=\\-]+))#i', array($this, 'smartideo_embed_handler_qq'));
wp_embed_register_handler('smartideo_sohu', '#https?://my\\.tv\\.sohu\\.com/(?:pl|us)/(?:\\d+)/(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_sohu'));
wp_embed_register_handler('smartideo_wasu', '#https?://www\\.wasu\\.cn/play/show/id/(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_wasu'));
wp_embed_register_handler('smartideo_yinyuetai', '#https?://v\\.yinyuetai\\.com/video/(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_yinyuetai'));
wp_embed_register_handler('smartideo_ku6', '#https?://v\\.ku6\\.com/show/(?<video_id>[a-z0-9\\-_\\.]+).html#i', array($this, 'smartideo_embed_handler_ku6'));
wp_embed_register_handler('smartideo_letv', '#https?://(?:[a-z0-9/]+\\.)?letv\\.com/(?:[a-z0-9/]+)/(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_letv'));
wp_embed_register_handler('smartideo_hunantv', '#https?://www\\.hunantv\\.com/(?:[a-z0-9/]+)/(?<video_id>\\d+)\\.html#i', array($this, 'smartideo_embed_handler_hunantv'));
wp_embed_register_handler('smartideo_acfun', '#https?://www\\.acfun\\.tv/v/ac(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_acfun'));
wp_embed_register_handler('smartideo_bilibili', '#https?://www\\.bilibili\\.com/video/av(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_bilibili'));
wp_embed_register_handler('smartideo_youtube', '#https?://www\\.youtube\\.com/watch\\?v=(?<video_id>\\w+)#i', array($this, 'smartideo_embed_handler_youtube'));
// music
wp_embed_register_handler('smartideo_music163', '#https?://music\\.163\\.com/\\#/song\\?id=(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_music163'));
wp_embed_register_handler('smartideo_xiami', '#https?://www\\.xiami\\.com/song/(?<video_id>\\d+)#i', array($this, 'smartideo_embed_handler_xiami'));
}
开发者ID:pemiu01,项目名称:smartideo,代码行数:42,代码来源:smartideo.php
示例17: __construct
/**
* Register hooks with WP Core
*/
function __construct()
{
self::$instance =& $this;
//i18n
add_action('init', array(&$this, 'i18n'));
//call hook to add admin menu to admin sidebar
add_action('admin_menu', array(&$this, 'add_menu'));
add_action('admin_bar_menu', array(&$this, 'admin_bar'), 100);
//register storify embed handler and callback
wp_embed_register_handler('storify', $this->permalink_regex, array($this, 'embed_handler'));
//register plugin with tinyMCE (WYSIWYG editor)
add_action('admin_init', array(&$this, 'tinymce_register'));
//enqueue css & js
add_action('admin_print_styles', array(&$this, 'enqueue_style'));
add_action('admin_enqueue_scripts', array(&$this, 'enqueue_script'));
// VIP Customization
add_action('wp_ajax_storify_dialog', array(&$this, 'dialog_button'));
//i18n
add_action('admin_enqueue_scripts', array(&$this, 'localize_scripts'));
//sanitization
add_filter('storify_login', array(&$this, 'sanitize_login'));
add_filter('storify_permalink', array(&$this, 'sanitize_permalink'), 20);
//callback handler from storify.com
add_action('admin_title', array(&$this, 'callback_handler'), 999);
add_filter('template_include', array(&$this, 'callback_redirect'));
add_filter('storify_permalink', array(&$this, 'maybe_add_http'), 0);
add_filter('storify_tags', array(&$this, 'hashtag_filter'), 5);
//iframe URL
add_filter('storify_iframe_url', array(&$this, 'iframe_url_edit_post_filter'));
add_filter('storify_iframe_url', array(&$this, 'iframe_url_add_callback_filter'), 100);
//metabox
add_action('add_meta_boxes', array(&$this, 'add_metabox'));
//noscript embeds
add_filter('storify_embed', array(&$this, 'noscript_link_embed_filter'), 5, 2);
add_filter('storify_embed', array(&$this, 'noscript_html_embed_filter'), 6, 2);
//description, title, tags
add_filter('wp_insert_post_data', array(&$this, 'maybe_add_description'));
//purge cache on update
add_action('storify_edit', array(&$this, 'cache_purge'), 10, 1);
//upgrade DB
//add_action( 'admin_init', array( &$this, 'upgrade' ) ); // VIP (2012-11-08): disabled as it kills sites with really large numbers of posts
}
开发者ID:humanmade,项目名称:vip-mu-plugins-public,代码行数:45,代码来源:storify.php
示例18: filters
/**
* add filters
*/
public static function filters()
{
add_filter('wpv_multiwidget_tab_title', array(__CLASS__, 'multiwidget_tab_title'), 10, 3);
add_action('wpv_multiwidget_single_title', array(__CLASS__, 'multiwidget_single_title'), 10, 2);
add_filter('wpv_posts_widget_thumbnail_name', array(__CLASS__, 'posts_widget_thumbnail_name'), 10, 2);
add_filter('wpv_posts_widget_img_size', array(__CLASS__, 'posts_widget_img_size'), 10, 2);
add_filter('wpv_column_title', array(__CLASS__, 'column_title'), 10, 2);
add_filter('excerpt_length', array(__CLASS__, 'excerpt_length'));
add_filter('excerpt_more', array(__CLASS__, 'excerpt_more'));
add_filter('wp_title', array(__CLASS__, 'wp_title'));
remove_filter('the_content', 'li_display_love_link', 100);
wp_embed_register_handler('wpv-swf', '#https?://[^\\s]+?.swf$#i', array(__CLASS__, 'embed_handler_swf'));
add_filter('pre_option_page_for_posts', create_function('$value', 'return 0;'));
add_filter('oembed_dataparse', array(__CLASS__, 'oembed_dataparse'), 90, 3);
add_filter('nav_menu_css_class', array(__CLASS__, 'nav_menu_css_class'), 10, 3);
add_filter('nav_menu_css_class', array(__CLASS__, 'nav_menu_css_class'), 11, 3);
add_action('wpv_body', array(__CLASS__, 'wpv_splash_screen'));
add_filter('wpcf7_form_elements', array(__CLASS__, 'shortcodes_in_cf7'));
add_filter('pre_option_wpv_header-layout', array(__CLASS__, 'header_layout'));
}
开发者ID:amitmula,项目名称:amitandaastha.in,代码行数:23,代码来源:shortcode-overrides.php
示例19: __construct
function __construct()
{
// Load Localization
add_action('plugins_loaded', array(&$this, 'lang'));
// Flash Player URL
$this->flash_player = plugins_url('3523697345-audio-player.swf', __FILE__);
// oEmbed Handler for mp3, ogg and wav
wp_embed_register_handler('html5_audio', '#^http://.+\\.(mp3|ogg|wav)$#i', array(&$this, 'pbwp_embed_handler_html5_audio'));
// Enqueue Scripts
//add_action('wp_enqueue_scripts', array(&$this, 'pbwp_embed_handler_html5_audio_jquery'));
// Register Metabox
add_action('add_meta_boxes', array(&$this, 'pbwp_register_metabox'));
// Register Shortcode
add_action('wp', array(&$this, 'pbwp_register_audio'));
//add_shortcode('audio', array(&$this, 'pbwp_html5_audio_shortcode'));
if (is_admin()) {
add_action('admin_print_scripts', array(&$this, 'pbwp_admin_scripts'));
add_action('admin_print_styles', array(&$this, 'pbwp_admin_styles'));
}
}
开发者ID:Telemedellin,项目名称:fonvalmed,代码行数:20,代码来源:pb-oEmbed-html5-audio.php
示例20: add_shortcodes_and_embed_handlers
/**
* Registers all of the shortcodes that this plugin will handle.
*
* Metacafe isn't supported by WordPress core but it was easy to add custom
* support for it, so it's callback handler is also registered here.
*
* @since 1.0.0
*/
public function add_shortcodes_and_embed_handlers() {
// These ones need special handling, such as allowing a video ID instead of a full URL.
add_shortcode( 'youtube', array( $this, 'shortcode_youtube' ) );
add_shortcode( 'dailymotion', array( $this, 'shortcode_dailymotion' ) );
add_shortcode( 'vimeo', array( $this, 'shortcode_vimeo' ) );
add_shortcode( 'metacafe', array( $this, 'shortcode_metacafe' ) );
wp_embed_register_handler( 'metacafe', '#https?://(www\.)?metacafe\.com/watch/([\d-]+)#i', array( $this, 'embed_handler_metacafe' ) );
// WordPress supports embedding certain video file types directly.
if ( function_exists( 'wp_video_shortcode' ) ) {
add_shortcode( 'flv', array( $this, 'video_shortcode_wrapper' ) );
add_shortcode( 'wmv', array( $this, 'video_shortcode_wrapper' ) );
}
// These services are dead or no longer supported by this plugin due to unpopularity.
// If a full video URL was passed to the shortcode, then it'll end up as a clickable link.
add_shortcode( 'googlevideo', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'gvideo', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'stage6', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'veoh', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'viddler', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'blip.tv', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'bliptv', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'ifilm', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'spike', array( $this, 'shortcode_dead_service' ) );
add_shortcode( 'myspace', array( $this, 'shortcode_dead_service' ) );
// Run everything else though the code that runs when you paste a URL on its own line.
// These will end up as clickable links unless another plugin can handle them.
add_shortcode( 'flickrvideo', array( $GLOBALS['wp_embed'], 'shortcode' ) );
add_shortcode( 'videofile', array( $GLOBALS['wp_embed'], 'shortcode' ) );
add_shortcode( 'avi', array( $GLOBALS['wp_embed'], 'shortcode' ) );
add_shortcode( 'mpeg', array( $GLOBALS['wp_embed'], 'shortcode' ) );
add_shortcode( 'flash', array( $GLOBALS['wp_embed'], 'shortcode' ) );
add_shortcode( 'quicktime', array( $GLOBALS['wp_embed'], 'shortcode' ) );
}
开发者ID:recetasdemama,项目名称:wordpress,代码行数:44,代码来源:vipers-video-quicktags-migrator.php
注:本文中的wp_embed_register_handler函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论