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
I am not sure what you want to do is doable (seems impossible to me but everything seems impossible until someone does it). I thought of a very ugly workaround.
This replaces get_header with get_header2 in all templates before loading.