I am well aware of the use of child themes for this. I know about get_header($name). I already understand the use of conditional tags.
I want my plugin to remove the function:
function get_header( $name = null ) {
do_action( 'get_header', $name );
$templates = array();
if ( isset($name) )
templates[] = "header-{$name}.php";
$templates[] = 'header.php';
// Backward compat code will be removed in a future release
if ('' == locate_template($templates, true))
load_template( ABSPATH . WPINC . '/theme-compat/header.php');
}
and the replace get_header() with:
function get_header( $name = null ) {
do_action( 'get_header', $name );
$templates = array();
if ( isset($name) )
templates[] = "header-{$name}.php";
$templates[] = 'header.php';
// Backward compat code will be removed in a future release
if ('' == locate_template($templates, true))
load_template( MY PLUGIN PATH/header.php');
}
php.net told me to use runkit_function_remove() but the website I am working on says this is an undefined function.
Any help would be much appreciated.
Leon