WP_MatchesMapRegex::callback() WordPress Method
The WP_MatchesMapRegex::callback() method is used to call a callback function for each matched element in a regular expression map. This is useful for performing operations on a set of matched elements, such as formatting or converting them.
WP_MatchesMapRegex::callback( array $matches ) #
preg_replace_callback hook
Contents
Parameters
- $matches
(array)(Required)preg_replace regexp matches
Return
(string)
Source
File: wp-includes/class-wp-matchesmapregex.php
public function callback( $matches ) { $index = (int) substr( $matches[0], 9, -1 ); return ( isset( $this->_matches[ $index ] ) ? urlencode( $this->_matches[ $index ] ) : '' ); }
Expand full source codeCollapse full source codeView on TracView on GitHub