首頁 >後端開發 >php教程 > 各位php高手帮小弟我看看这段代码是什么意思

各位php高手帮小弟我看看这段代码是什么意思

WBOY
WBOY原創
2016-06-13 12:47:09888瀏覽

各位php高手帮我看看这段代码是什么意思

<br />
function apply_filters($tag, $value) {<br />
	global $wp_filter, $merged_filters, $wp_current_filter;<br />
<br />
	$args = array();<br />
<br />
	if ( isset($wp_filter['all']) ) {<br />
		$wp_current_filter[] = $tag;<br />
		$args = func_get_args();<br />
		_wp_call_all_hook($args);<br />
	}<br />
<br />
	if ( !isset($wp_filter[$tag]) ) {<br />
		if ( isset($wp_filter['all']) )<br />
			array_pop($wp_current_filter);<br />
		return $value;<br />
	}<br />
<br />
	if ( !isset($wp_filter['all']) )<br />
		$wp_current_filter[] = $tag;<br />
<br />
	if ( !isset( $merged_filters[ $tag ] ) ) {<br />
		ksort($wp_filter[$tag]);<br />
		$merged_filters[ $tag ] = true;<br />
	}<br />
<br />
	reset( $wp_filter[ $tag ] );<br />
<br />
	if ( empty($args) )<br />
		$args = func_get_args();<br />
<br />
	do {<br />
		foreach( (array) current($wp_filter[$tag]) as $the_ )<br />
			if ( !is_null($the_['function']) ){<br />
				$args[1] = $value;<br />
				$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));<br />
			}<br />
<br />
	} while ( next($wp_filter[$tag]) !== false );<br />
<br />
	array_pop( $wp_current_filter );<br />
<br />
	return $value;<br />
}<br />


<br />
function the_permalink() {<br />
	echo apply_filters('the_permalink', get_permalink());<br />
}<br />

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn