WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

WP_Embed::autoembed() public WP 1.0

Passes any unlinked URLs that are on their own line to WP_Embed::shortcode() for potential embedding.

Это метод класса: WP_Embed{}

Хуков нет.

Возвращает

Строку. Potentially modified $content.

Использование

$WP_Embed = new WP_Embed();
$WP_Embed->autoembed( $content );
$content(строка) (обязательный)
The content to be searched.

Заметки

  • Смотрите: WP_Embed::autoembed_callback()

Код WP Embed::autoembed: wp-includes/class-wp-embed.php WP 5.5.1

<?php
public function autoembed( $content ) {
	// Replace line breaks from all HTML elements with placeholders.
	$content = wp_replace_in_html_tags( $content, array( "\n" => '<!-- wp-line-break -->' ) );

	if ( preg_match( '#(^|\s|>)https?://#i', $content ) ) {
		// Find URLs on their own line.
		$content = preg_replace_callback( '|^(\s*)(https?://[^\s<>"]+)(\s*)$|im', array( $this, 'autoembed_callback' ), $content );
		// Find URLs in their own paragraph.
		$content = preg_replace_callback( '|(<p(?: [^>]*)?>\s*)(https?://[^\s<>"]+)(\s*<\/p>)|i', array( $this, 'autoembed_callback' ), $content );
	}

	// Put the line breaks back.
	return str_replace( '<!-- wp-line-break -->', "\n", $content );
}