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

原创
2016-06-13 11:24:25 584浏览

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


function apply_filters($tag, $value) {
global $wp_filter, $merged_filters, $wp_current_filter;

$args = array();

if ( isset($wp_filter['all']) ) {
$wp_current_filter[] = $tag;
$args = func_get_args();
_wp_call_all_hook($args);
}

if ( !isset($wp_filter[$tag]) ) {
if ( isset($wp_filter['all']) )
array_pop($wp_current_filter);
return $value;
}

if ( !isset($wp_filter['all']) )
$wp_current_filter[] = $tag;

if ( !isset( $merged_filters[ $tag ] ) ) {
ksort($wp_filter[$tag]);
$merged_filters[ $tag ] = true;
}

reset( $wp_filter[ $tag ] );

if ( empty($args) )
$args = func_get_args();

do {
foreach( (array) current($wp_filter[$tag]) as $the_ )
if ( !is_null($the_['function']) ){
$args[1] = $value;
$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
}

} while ( next($wp_filter[$tag]) !== false );

array_pop( $wp_current_filter );

return $value;
}



function the_permalink() {
echo apply_filters('the_permalink', get_permalink());
}
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。