plugins - Nested Actions and Filters

admin2025-04-21  0

It is possible and a good practice to combine filters and actions, it is necessary to take into account the order in which they are executed, a graphic example

Here I show you the example of the code I want to make:

Action parent + Filter child

add_action( "init", "parent_action");
function parent_action()
{
    add_filter( "any", "child_filter");
    function child_filter() 
    {

    }
}

Action parent + Action child

add_action( "init", "parent_action");
function parent_action()
{
    add_action( "any", "child_action");
    function child_action() 
    {

    }
}
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745176859a288962.html

最新回复(0)