wpseek.com
WordPress开发者和主题制作者的搜索引擎



pre_wp_nav_menu › WordPress过滤钩子

Since3.9.0
已弃用n/a
apply_filters( 'pre_wp_nav_menu', null, $args )
参数: (2)
  • (string|null) $output Nav menu output to short-circuit with. Default null.
    Required: Yes
  • (stdClass) $args An object containing wp_nav_menu() arguments.
    Required: Yes
定义在:
文档:

Filters whether to short-circuit the wp_nav_menu() output.

Returning a non-null value from the filter will short-circuit wp_nav_menu(), echoing that value if $args->echo is true, returning that value otherwise.





源码

$nav_menu = apply_filters( 'pre_wp_nav_menu', null, $args );