jQuery(document).ready(function($){
$.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>");
});
jQuery(document).ready(function($){
$.get("<?php echo admin_url( 'admin-ajax.php?action=oembed-cache&post=' . $post->ID, 'relative' ); ?>");
});
* @type int $height Height of the embed in pixels.
* }
* @param string $url The URL attempting to be embedded.
* @type int $height Height of the embed in pixels.
* }
* @param string $url The URL attempting to be embedded.
- * @return string The embed HTML on success, otherwise the original URL.
+ * @return string|false The embed HTML on success, otherwise the original URL.
+ * `->maybe_make_link()` can return false on failure.
- return preg_replace_callback( '|^\s*(https?://[^\s"]+)\s*$|im', array( $this, 'autoembed_callback' ), $content );
+ return preg_replace_callback( '|^(\s*)(https?://[^\s"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content );
public function autoembed_callback( $match ) {
$oldval = $this->linkifunknown;
$this->linkifunknown = false;
public function autoembed_callback( $match ) {
$oldval = $this->linkifunknown;
$this->linkifunknown = false;