本文整理汇总了PHP中get_oembed_endpoint_url函数的典型用法代码示例。如果您正苦于以下问题:PHP get_oembed_endpoint_url函数的具体用法?PHP get_oembed_endpoint_url怎么用?PHP get_oembed_endpoint_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_oembed_endpoint_url函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: test_add_oembed_discovery_links_to_attachment
function test_add_oembed_discovery_links_to_attachment()
{
$post_id = self::factory()->post->create();
$file = DIR_TESTDATA . '/images/canola.jpg';
$attachment_id = self::factory()->attachment->create_object($file, $post_id, array('post_mime_type' => 'image/jpeg'));
$this->go_to(get_permalink($attachment_id));
$this->assertQueryTrue('is_attachment', 'is_singular', 'is_single');
$expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink())) . '" />' . "\n";
$expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink(), 'xml')) . '" />' . "\n";
$this->assertEquals($expected, get_echo('wp_oembed_add_discovery_links'));
}
开发者ID:boonebgorges,项目名称:develop.wordpress,代码行数:11,代码来源:discovery.php
示例2: test_add_oembed_discovery_links
/**
* Test output of add_oembed_discovery_links.
*/
function test_add_oembed_discovery_links()
{
$post_id = $this->factory->post->create();
$this->go_to(get_permalink($post_id));
$this->assertQueryTrue('is_single', 'is_singular');
ob_start();
wp_oembed_add_discovery_links();
$actual = ob_get_clean();
$expected = '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink())) . '" />' . "\n";
$expected .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink(), 'xml')) . '" />' . "\n";
$this->assertEquals($expected, $actual);
}
开发者ID:kanenas,项目名称:oEmbed-API,代码行数:15,代码来源:test-frontend.php
示例3: wp_oembed_add_discovery_links
/**
* Add oEmbed discovery links in the website <head>.
*/
function wp_oembed_add_discovery_links()
{
$output = '';
if (is_singular()) {
$output .= '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink())) . '" />' . "\n";
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink(), 'xml')) . '" />' . "\n";
}
/**
* Filter the oEmbed discovery links.
*
* @param string $output HTML of the discovery links.
*/
echo apply_filters('oembed_discovery_links', $output);
}
开发者ID:hinaloe,项目名称:oEmbed-API,代码行数:17,代码来源:functions.php
示例4: test_get_oembed_endpoint_url
function test_get_oembed_endpoint_url()
{
$this->assertEquals(home_url() . '/?oembed=true', get_oembed_endpoint_url());
$this->assertEquals(home_url() . '/?oembed=true', get_oembed_endpoint_url('', 'json'));
$this->assertEquals(home_url() . '/?oembed=true', get_oembed_endpoint_url('', 'xml'));
$post_id = self::factory()->post->create();
$url = get_permalink($post_id);
$url_encoded = urlencode($url);
$this->assertEquals(home_url() . '/?oembed=true&url=' . $url_encoded, get_oembed_endpoint_url($url));
$this->assertEquals(home_url() . '/?oembed=true&url=' . $url_encoded . '&format=xml', get_oembed_endpoint_url($url, 'xml'));
}
开发者ID:rclilly,项目名称:wordpress-develop,代码行数:11,代码来源:controller.php
示例5: wp_oembed_add_discovery_links
/**
* Adds oEmbed discovery links in the website <head>.
*
* @since 4.4.0
*/
function wp_oembed_add_discovery_links()
{
$output = '';
if (is_singular() && !is_front_page()) {
$output .= '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink())) . '" />' . "\n";
if (class_exists('SimpleXMLElement')) {
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url(get_permalink(), 'xml')) . '" />' . "\n";
}
}
/**
* Filter the oEmbed discovery links HTML.
*
* @since 4.4.0
*
* @param string $output HTML of the discovery links.
*/
echo apply_filters('oembed_discovery_links', $output);
}
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:23,代码来源:embed.php
示例6: wp_idea_stream_oembed_add_discovery_links
/**
* Adds oEmbed discovery links in the website <head> for the IdeaStream user's profile root page.
*
* @since 2.3.0
*/
function wp_idea_stream_oembed_add_discovery_links()
{
if (!wp_idea_stream_is_user_profile_ideas() || !wp_idea_stream_is_embed_profile()) {
return;
}
$user_link = wp_idea_stream_users_get_user_profile_url(wp_idea_stream_users_displayed_user_id(), '', true);
$output = '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url($user_link)) . '" />' . "\n";
if (class_exists('SimpleXMLElement')) {
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url($user_link, 'xml')) . '" />' . "\n";
}
/**
* Filter the oEmbed discovery links HTML.
*
* @since 2.3.0
*
* @param string $output HTML of the discovery links.
*/
echo apply_filters('wp_idea_stream_users_oembed_add_discovery_links', $output);
}
开发者ID:BoweFrankema,项目名称:wp-idea-stream,代码行数:24,代码来源:template-functions.php
示例7: wp_oembed_add_site_as_provider
/**
* Add this site to the whitelist of oEmbed providers.
*/
function wp_oembed_add_site_as_provider()
{
wp_oembed_add_provider(home_url('/*'), get_oembed_endpoint_url());
}
开发者ID:kanenas,项目名称:oEmbed-API,代码行数:7,代码来源:functions.php
示例8: test_get_oembed_endpoint_url_pretty_permalinks
/**
* Test get_oembed_endpoint_url
*/
function test_get_oembed_endpoint_url_pretty_permalinks()
{
update_option('permalink_structure', '/%postname%');
$this->assertEquals(home_url() . '/wp-json/wp/v2/oembed', get_oembed_endpoint_url());
$this->assertEquals(home_url() . '/wp-json/wp/v2/oembed', get_oembed_endpoint_url('', 'xml'));
$post_id = $this->factory->post->create();
$url = get_permalink($post_id);
$this->assertEquals(home_url() . '/wp-json/wp/v2/oembed?url=' . $url, get_oembed_endpoint_url($url));
$this->assertEquals(home_url() . '/wp-json/wp/v2/oembed?url=' . $url . '&format=xml', get_oembed_endpoint_url($url, 'xml'));
update_option('permalink_structure', '');
}
开发者ID:noplanman,项目名称:oEmbed-API,代码行数:14,代码来源:test-wp-rest-oembed-controller.php
示例9: add_oembed_discovery_links
/**
* Adds oEmbed discovery links on single activity pages.
*
* @since 2.6.0
*
* @param string $retval Current discovery links.
* @return string
*/
public function add_oembed_discovery_links($retval)
{
if (!$this->is_page()) {
return $retval;
}
$permalink = $this->set_permalink();
if (empty($permalink)) {
return $retval;
}
add_filter('rest_url', array($this, 'filter_rest_url'));
$retval = '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url($permalink)) . '" />' . "\n";
if (class_exists('SimpleXMLElement')) {
$retval .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url($permalink, 'xml')) . '" />' . "\n";
}
remove_filter('rest_url', array($this, 'filter_rest_url'));
return $retval;
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:25,代码来源:class-bp-core-oembed-extension.php
示例10: oembed_discovery_links_for_recurring_events
/**
* Outputs oembed resource links on the /all/ pages for recurring events
*
* @since 4.2
*
* @param string $output Resource links to output
*
* @return string
*/
public function oembed_discovery_links_for_recurring_events($output)
{
global $wp_query;
if ($output) {
return $output;
}
if (!tribe_is_showing_all()) {
return $output;
}
if (empty($wp_query->posts[0])) {
return $output;
}
$post = $wp_query->posts[0];
$post_id = $post->ID;
$output = '<link rel="alternate" type="application/json+oembed" href="' . esc_url(get_oembed_endpoint_url(add_query_arg('post_id', $post_id, get_permalink($post_id)))) . '" />' . "\n";
if (class_exists('SimpleXMLElement')) {
$output .= '<link rel="alternate" type="text/xml+oembed" href="' . esc_url(get_oembed_endpoint_url(add_query_arg('post_id', $post_id, get_permalink($post_id)), 'xml')) . '" />' . "\n";
}
return $output;
}
开发者ID:TakenCdosG,项目名称:chefs,代码行数:29,代码来源:Main.php
注:本文中的get_oembed_endpoint_url函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论