W3cubDocs

/WordPress

WP_MatchesMapRegex::callback( array $matches )

preg_replace_callback hook

Parameters

$matches

(array) (Required) preg_replace regexp matches

Return

(string)

Source

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

public function callback( $matches ) {
		$index = intval( substr( $matches[0], 9, -1 ) );
		return ( isset( $this->_matches[ $index ] ) ? urlencode( $this->_matches[ $index ] ) : '' );
	}

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_matchesmapregex/callback