WordPressを読む 12-2 /blog/wp-includes/class-wp.php 2
2014/11/29
目次
- 1 クラス WP_MatchesMapRegex
- 2 定義ファイル : /blog/wp-includes/class-wp.php 2
- 3 読込元 : /blog/wp-settings.php
- 4 WP_MatchesMapRegex::クラス変数
- 5 WP_MatchesMapRegex::__get()
- 6 WP_MatchesMapRegex::__set()
- 7 WP_MatchesMapRegex::__isset()
- 8 WP_MatchesMapRegex::__unset()
- 9 WP_MatchesMapRegex::__call()
- 10 WP_MatchesMapRegex::WP_MatchesMapRegex()コンストラクタ
- 11 WP_MatchesMapRegex::apply()
- 12 WP_MatchesMapRegex::_map()
- 13 WP_MatchesMapRegex::callback()
クラス WP_MatchesMapRegex
定義ファイル : /blog/wp-includes/class-wp.php 2
読込元 : /blog/wp-settings.php
WP_MatchesMapRegex::クラス変数
1 2 3 4 5 | class WP_MatchesMapRegex { private $_matches; public $output; private $_subject; public $_pattern = '(\$matches\[[1-9]+[0-9]*\])'; // magic number |
メソッド
WP_MatchesMapRegex::__get()
1 2 3 | public function __get( $name ) { return $this->$name; } |
メソッド
WP_MatchesMapRegex::__set()
1 2 3 | public function __set( $name, $value ) { return $this->$name = $value; } |
メソッド
WP_MatchesMapRegex::__isset()
1 2 3 | public function __isset( $name ) { return isset( $this->$name ); } |
メソッド
WP_MatchesMapRegex::__unset()
1 2 3 | public function__unset( $name ) { unset( $this->$name ); } |
メソッド
WP_MatchesMapRegex::__call()
1 2 3 | public function __call( $name, $arguments ) { return call_user_func_array( array( $this, $name ), $arguments ); } |
メソッド
WP_MatchesMapRegex::WP_MatchesMapRegex()コンストラクタ
1 2 3 4 5 | public function WP_MatchesMapRegex($subject, $matches) { $this->_subject = $subject; $this->_matches = $matches; $this->output = $this->_map(); } |
メソッド
WP_MatchesMapRegex::apply()
1 2 3 4 | public static function apply($subject, $matches) { $oSelf = new WP_MatchesMapRegex($subject, $matches); return $oSelf->output; } |
メソッド
WP_MatchesMapRegex::_map()
1 2 3 4 | private function _map() { $callback = array($this, 'callback'); return preg_replace_callback($this->_pattern, $callback, $this->_subject); } |
メソッド
WP_MatchesMapRegex::callback()
1 2 3 4 5 6 | public function callback($matches) { $index = intval(substr($matches[0], 9, -1)); return ( isset( $this->_matches[$index] ) ? urlencode($this->_matches[$index]) : '' ); } } |