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

php - Nested "do" and "add" Actions is possible?

programmeradmin1浏览0评论

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');
}

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');
}
Share Improve this question asked Feb 22, 2021 at 6:40 km onurkm onur 1592 silver badges6 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 2

Yes, you can nest actions.

Yes, your example will cause an infinite loop.

发布评论

评论列表(0)

  1. 暂无评论