Does hooking into a plugin actionfilter override the plugin's function for that hook?

I have a question about how actions and filters interact with functions:I am currently using an event ticketing plugin f

I have a question about how actions and filters interact with functions:

I am currently using an event ticketing plugin for wordpress, there are built in validation rules that is already in the plugin (i.e. fields are all completed, number fields contain integers etc.). I want to write a function that 'extends' the existing plugin function. When I write my functions, does the existing plugin function for that hook still apply? Or would I have to copy over parts of that function I want to retain into my new one? Or does wordpress run both functions in some kind of sequence?

If I wanted to write a validation that is the opposite of what is currently in the plugin function (i.e. number fields should contain an alphabetical character) how does a custom function overwrite a part of an existing function? Would I have to remove those lines in the plugin file itself?

Thanks in advance.

I have a question about how actions and filters interact with functions:

I am currently using an event ticketing plugin for wordpress, there are built in validation rules that is already in the plugin (i.e. fields are all completed, number fields contain integers etc.). I want to write a function that 'extends' the existing plugin function. When I write my functions, does the existing plugin function for that hook still apply? Or would I have to copy over parts of that function I want to retain into my new one? Or does wordpress run both functions in some kind of sequence?

If I wanted to write a validation that is the opposite of what is currently in the plugin function (i.e. number fields should contain an alphabetical character) how does a custom function overwrite a part of an existing function? Would I have to remove those lines in the plugin file itself?

Thanks in advance.

Share Improve this question asked Aug 13, 2019 at 2:06 machumpmachump 1237 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

It depends entirely on the specific plugin and the specific hook. It's completely up to plugin developers what they want to allow other developers to do. They could allow developers to replace entire functions; to perform a custom action at the beginning, middle, or end of a function; to modify the result of a function; or none of the above. It's impossible to give a generic answer.

The only way to know what you can do is to consult the developer documentation for the plugin, which will tell you what you can do. If that doesn't exist, reading the actual code of the plugin and looking for hooks is all you can do.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745247610a4618483.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信