WP_Embed::autoembed_callback() WordPress Method

The WP_Embed::autoembed_callback() method is used to automatically embeds URLs in content. It is called by the wp_embed_register_handler() function.

WP_Embed::autoembed_callback( array $matches ) #

Callback function for WP_Embed::autoembed().


Parameters

$matches

(array)(Required)A regex match array.


Top ↑

Return

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


Top ↑

Source

File: wp-includes/class-wp-embed.php

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

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.