I'm making a child theme for Suffusion. I need to rewrite one function defined in "../suffusion/functions/actions.php" and put that rewritten function in "wp-content/themes/suffusion-child/functions/actions.php".
But I want to preserve "../suffusion/functions/actions.php" unchanged in any way. (Future theme updates would just overwrite any changes I made. And I don't want to simply replace Suffusion's "actions.php" altogether, because then I won't benefit from any future updates to it, and my child theme might just break altogether.
So, in my new "actions.php", I put an include followed by the replacement function definition, named identically to the one I want to replace:
- Code: Select all
function foo($arg_1, $arg_2, /* ..., */ $arg_n)
echo "All my new code.\n";
Because this duplicate foo() function definition comes after the foo()
defined in the included file, does it replace the included foo()?
Or how can I achieve what I want?
Big thanks in advance for any suggestions.