How to *remove* a parent theme page template from a child theme?

Overriding that template would be much easier than getting rid of it. Just the way logic goes.

I make no claim it’s efficient idea (late here), but this would get it nuked from edit screen:

add_action('admin_head-post.php','remove_template');

function remove_template() {

    global $wp_themes;

    get_themes();
    $templates = &$wp_themes['Twenty Ten']['Template Files'];
    $template = trailingslashit( TEMPLATEPATH ).'onecolumn-page.php';
    $key = array_search($template, $templates);
    unset( $templates[$key] );
}

Leave a Comment