How to remove a parent theme template

Taken from here: http://wordpress.stackexchange.com/a/58081/13712

<code>add_action('admin_head', 'wpse_13671_script_enqueuer');

function wpse_13671_script_enqueuer() {
global $current_screen;

/**
* /wp-admin/edit.php?post_type=page
*/
if('edit-page' == $current_screen->id)
{
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
$("a.editinline").live("click", function () {
var ilc_qe_id = inlineEditPost.getId(this);
setTimeout(function() {
$('#edit-'+ilc_qe_id+' select[name="page_template"] option[value="showcase.php"]').remove();
}, 100);
});

$('#doaction, #doaction2').live("click", function () {
setTimeout(function() {
$('#bulk-edit select[name="page_template"] option[value="showcase.php"]').remove();
}, 100);
});
});
</script>
<?php
}

/**
* /wp-admin/post.php?post=21&action=edit
*/
if( 'page' == $current_screen->id )
{
?>
<script type="text/javascript">
jQuery(document).ready( function($) {
$('#page_template option[value="showcase.php"]').remove();
});
</script>
<?php
}
}</code>

Revisions

Tags: , , , , ,

No comments yet.

Leave a Reply