/** * @since 3.6.1 * @return string The generate HTML output. */ public function _replyToProcessShortcode_embed($aAttributes, $sURL, $sShortcode = '') { $sURL = isset($aAttributes['src']) ? $aAttributes['src'] : $sURL; $_sHTML = wp_oembed_get($sURL); // If there was a result, return it if ($_sHTML) { // This filter is documented in wp-includes/class-wp-embed.php return "<div class='video oembed'>" . apply_filters('embed_oembed_html', $_sHTML, $sURL, $aAttributes, 0) . "</div>"; } // If not found, return the link. $_oWPEmbed = new WP_Embed(); return "<div class='video oembed'>" . $_oWPEmbed->maybe_make_link($sURL) . "</div>"; }
public function test_maybe_make_link_do_not_link_if_unknown() { $url = 'http://example.com/'; $this->wp_embed->linkifunknown = false; $this->assertEquals($url, $this->wp_embed->maybe_make_link($url)); }