Auto link unembeddable document urls

This commit is contained in:
leogermani 2018-09-24 18:19:02 -03:00
parent 2d17905a91
commit 3b8883ba05
1 changed files with 5 additions and 1 deletions

View File

@ -633,7 +633,11 @@ class Item extends Entity {
if ( $type == 'url' ) {
global $wp_embed;
$output .= $wp_embed->autoembed($this->get_document());
$_embed = $wp_embed->autoembed($this->get_document());
if ( $_embed == $this->get_document() ) {
$_embed = sprintf('<a href="%s" target="blank">%s</a>', $this->get_document(), $this->get_document());
}
$output .= $_embed;
} elseif ( $type == 'text' ) {
$output .= $this->get_document();
} elseif ( $type == 'attachment' ) {