Hi I am writing a small plug-in which I get some content from outside of WordPress and I want a small script to trigger whenever a new post, page or comment is added. Also if any Widgets, themes and Plug-ins are Activated or De-Activated.
My guess is that I should be using the action hooks for this but since there are multiple actions so how to get all those actions in some array or so.
class getStatic {
var $_renderTasksOn =
array(
<!-- How do I call those actions in an array here -->
)
function gerStatic() {
<!-- Here goes the script to get external data -->
}
}
I am very new to programming hence kindly help with the code. How do I use those action hooks?
Kindly help.
If you want to hook into multiple actions, you have to call
add_action
multiple times. However, this is not so hard. Let’s take your plugin class as an example: