Php wordpress在同一函数上应用过滤器
我在wordpress主题中找到了一个代码片段Php wordpress在同一函数上应用过滤器,php,wordpress,wordpress-hook,Php,Wordpress,Wordpress Hook,我在wordpress主题中找到了一个代码片段 function jm_resume_custom_fields_prefix() { return apply_filters( 'jm_resume_custom_fields_prefix', '_noo_resume_field_' ); } 上面的代码是什么意思?应用过滤器在此上下文中如何工作?操作/过滤器标记和函数位于不同的名称空间中。这意味着当执行函数jm_resume_custom_fields_prefi
function jm_resume_custom_fields_prefix() {
return apply_filters( 'jm_resume_custom_fields_prefix', '_noo_resume_field_' );
}
上面的代码是什么意思?应用过滤器在此上下文中如何工作?操作/过滤器标记和函数位于不同的名称空间中。这意味着当执行函数jm_resume_custom_fields_prefix()时,所有绑定到标记“jm_resume_custom_fields_prefix”(通过add_filter('jm_resume_custom_fields_prefix',…)的过滤器都将被应用。WordPress中大量使用了将执行操作/过滤器的函数命名为操作/过滤器标记的约定