Home > Backend Development > PHP Tutorial > 各位php高手帮小弟我看看这段代码是什么意思

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

WBOY
Release: 2016-06-13 12:47:09
Original
891 people have browsed it

各位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 />
Copy after login


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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template