Can I make an array of functions and execute the functions with a foreach loop?
Like:
// This is the beginning of the php file
global $actions = array();
// This is the function where functions need to be added.
function HeadFunction(){
foreach($actions as $action)
$action;
}
This is the function to add the action
function add_action($action){
global $actions;
$actions[] = $action;
}
This is a example function:
function check_Url(){
if(isset($_GET['gettest'])){
echo '<script>alert(\'This is a test\');</script>';
}
}
and then add the function with: add_action(check_Url());