Nested “do” and “add” Actions is possible?
Question
I'm wondering
Questions were asked about more than one "add_action
" and filter nested before and it was deemed possible.
Are nested cross actions added?
Eg.
add_action('init', function(){
do_action('initialized');
});
function initialized(){
// ...
}
Second question
Will a vicious circle occur like the following?
function initialized(){
do_action('init');
}
Solution
Yes, you can nest actions.
Yes, your example will cause an infinite loop.
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange