WP_Embed::autoembed_callback()publicWP 1.0

Callback function for WP_Embed::autoembed().

Method of the class: WP_Embed{}

No Hooks.

Return

String. The embed HTML on success, otherwise the original URL.

Usage

global $wp_embed;
$wp_embed->autoembed_callback( $matches );
$matches(array) (required)
A regex match array.

WP_Embed::autoembed_callback() code WP 6.5.2

public function autoembed_callback( $matches ) {
	$oldval              = $this->linkifunknown;
	$this->linkifunknown = false;
	$return              = $this->shortcode( array(), $matches[2] );
	$this->linkifunknown = $oldval;

	return $matches[1] . $return . $matches[3];
}