首页 WordPress函数大全 remove_filter()

remove_filter()

2020-05-02 / 4808阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

remove_filter( string $tag, callable $function_to_remove, int $priority = 10 )

从指定的过滤器挂钩中删除功能。

描述

此函数删除附加到指定过滤器挂钩的函数。此方法可用于删除附加到特定过滤器挂钩的默认功能,并可能用替代品替换它们。

要删除一个钩子,添加钩子时,$ function_to_remove和$ priority参数必须匹配。这适用于过滤器和操作。不会发出警告>

参数

$tag

(string)
(Required)
The filter hook to which the function to be removed is hooked.

$function_to_remove

(callable)
(Required)
The name of the function which should be removed.

$priority

(int)
(Optional)
The priority of the function.

Default value: 10

返回

(bool) Whether the function existed before it was removed.

大家谈论
    我的见解