Update WP and plugins
This commit is contained in:
parent
10a4713229
commit
1fb77fc4ff
864 changed files with 101724 additions and 78262 deletions
|
@ -46,10 +46,10 @@ class WP_MatchesMapRegex {
|
|||
* @param string $subject subject if regex
|
||||
* @param array $matches data to use in map
|
||||
*/
|
||||
public function __construct($subject, $matches) {
|
||||
public function __construct( $subject, $matches ) {
|
||||
$this->_subject = $subject;
|
||||
$this->_matches = $matches;
|
||||
$this->output = $this->_map();
|
||||
$this->output = $this->_map();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -57,14 +57,12 @@ class WP_MatchesMapRegex {
|
|||
*
|
||||
* static helper function to ease use
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @param string $subject subject
|
||||
* @param array $matches data used for substitution
|
||||
* @return string
|
||||
*/
|
||||
public static function apply($subject, $matches) {
|
||||
$oSelf = new WP_MatchesMapRegex($subject, $matches);
|
||||
public static function apply( $subject, $matches ) {
|
||||
$oSelf = new WP_MatchesMapRegex( $subject, $matches );
|
||||
return $oSelf->output;
|
||||
}
|
||||
|
||||
|
@ -74,8 +72,8 @@ class WP_MatchesMapRegex {
|
|||
* @return string
|
||||
*/
|
||||
private function _map() {
|
||||
$callback = array($this, 'callback');
|
||||
return preg_replace_callback($this->_pattern, $callback, $this->_subject);
|
||||
$callback = array( $this, 'callback' );
|
||||
return preg_replace_callback( $this->_pattern, $callback, $this->_subject );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -84,8 +82,8 @@ class WP_MatchesMapRegex {
|
|||
* @param array $matches preg_replace regexp matches
|
||||
* @return string
|
||||
*/
|
||||
public function callback($matches) {
|
||||
$index = intval(substr($matches[0], 9, -1));
|
||||
return ( isset( $this->_matches[$index] ) ? urlencode($this->_matches[$index]) : '' );
|
||||
public function callback( $matches ) {
|
||||
$index = intval( substr( $matches[0], 9, -1 ) );
|
||||
return ( isset( $this->_matches[ $index ] ) ? urlencode( $this->_matches[ $index ] ) : '' );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue