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.
Return
(string) The embed HTML on success, otherwise the original URL.
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]; }
Expand full source codeCollapse full source codeView on TracView on GitHub