當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WP_oEmbed::get_html方法代碼示例

本文整理匯總了PHP中WP_oEmbed::get_html方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_oEmbed::get_html方法的具體用法?PHP WP_oEmbed::get_html怎麽用?PHP WP_oEmbed::get_html使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WP_oEmbed的用法示例。


在下文中一共展示了WP_oEmbed::get_html方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: test_wp_filter_pre_oembed_result_non_existent_post

 public function test_wp_filter_pre_oembed_result_non_existent_post()
 {
     $post_id = self::factory()->post->create();
     $permalink = get_permalink($post_id);
     $this->go_to($permalink);
     $this->assertQueryTrue('is_single', 'is_singular');
     add_filter('pre_oembed_result', array($this, '_filter_pre_oembed_result'));
     $actual = $this->oembed->get_html('https://example.com/');
     remove_filter('pre_oembed_result', array($this, '_filter_pre_oembed_result'));
     $this->assertTrue(false !== $this->pre_oembed_result_filtered);
     $this->assertFalse($actual);
 }
開發者ID:atimmer,項目名稱:wordpress-develop-mirror,代碼行數:12,代碼來源:wpOembed.php

示例2: get_html

 /**
  * The do-it-all function that takes a URL and attempts to return the HTML.
  *
  * @see WP_oEmbed::discover()
  * @see WP_oEmbed::fetch()
  * @see WP_oEmbed::data2html()
  *
  * @param string $url The URL to the content that should be attempted to be embedded.
  * @param array $args Optional arguments. Usually passed from a shortcode.
  * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
  */
 public function get_html($strURL, $arrArgs = array())
 {
     if (isset($GLOBALS['arrFetchTweets_oEmbed'][$strURL])) {
         return $GLOBALS['arrFetchTweets_oEmbed'][$strURL];
     }
     $strHTML = parent::get_html($strURL, $arrArgs);
     // Store the result in the global array.
     $GLOBALS['arrFetchTweets_oEmbed'][$strURL] = $strHTML;
     return $strHTML;
 }
開發者ID:snickler,項目名稱:Fetch-Tweets,代碼行數:21,代碼來源:FetchTweets_oEmbed.php


注:本文中的WP_oEmbed::get_html方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。