WP_Embed::autoembed_callback( array $matches ): string

In this article

Callback function for WP_Embed::autoembed().

Parameters

$matchesarrayrequired
A regex match array.

Return

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

Source

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];
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.