最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

hooks - What is the difference between add_action and add_filter

programmeradmin0浏览0评论
This question already has answers here: Difference Between Filter and Action Hooks? (4 answers) Closed 5 years ago.

I just want to know what is the difference between the add_action and add_filter. I just could not get it enough in the documentation of wordpress. Can anyone explain it more broader and simpler. Thank you in advance.

This question already has answers here: Difference Between Filter and Action Hooks? (4 answers) Closed 5 years ago.

I just want to know what is the difference between the add_action and add_filter. I just could not get it enough in the documentation of wordpress. Can anyone explain it more broader and simpler. Thank you in advance.

Share Improve this question edited Sep 25, 2019 at 16:46 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Sep 25, 2019 at 7:53 Lucifer LeviLucifer Levi 932 silver badges11 bronze badges 0
Add a comment  | 

1 Answer 1

Reset to default 4

add_action

add_action is what you use to create a trigger “hook” – when something happens, do-something-else.

add_Filter add_filter is used to “hook” data change/replace – where there is [some-code], change it to some-other-expanded-code. add_filter ( string $tag, callable $function_to_add, int $priority = 10, int $accepted_args = 1 ) Hook a function or method to a specific filter action. WordPress offers filter hooks to allow plugins to modify various types of internal data at runtime. A plugin can modify data by binding a callback to a filter hook. When the filter is later applied, each bound callback is run in order of priority, and given the opportunity to modify a value by returning a new value.

发布评论

评论列表(0)

  1. 暂无评论