include() and duplicate function definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, :-)

I'm making a child theme for WordPress. I need to rewrite one function
defined in "../sometheme/functions/actions.php" and put that rewritten
function in "wp-content/themes/sometheme-child/functions/actions.php".

But I want to preserve "../sometheme/functions/actions.php" unchanged
in any way. (Future theme updates would just overwrite any changes I
made.)

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:

<?php

include '../sometheme/functions/actions.php';

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. :-)

David

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux