La solución en la que puedo pensar es eliminar los paneles Widgets disponibles e inactivos, por lo que simplemente no hay dónde arrastrar (y eliminar) los widgets utilizados en la barra lateral.
Puedes inyectar otra cosa para llenar el vacío.
En este ejemplo, solo un usuario puede agregar / eliminar widgets.
function wpse_53398_script_printer(){
// used to display the front end site
$site = get_site_url();
// here you can filter who can add/delete widgets
global $current_user;
if ( 'kursus' == $current_user->data->user_login )
{
echo <<<HTML
<!-- CSS to hide the widgets descriptions = real estate gains -->
<style type="text/css">#widget-list .widget-description {display:none;}</style>
<script type="text/javascript">
jQuery(document).ready( function($) {
// swaps the placement of the panels Available Widgets and Incactive Widgets
$('#available-widgets').appendTo('#widgets-left');
});
</script>
HTML;
}
else
{
echo <<<HTML
<!-- CSS to prevent the div from briefly appearing before the jQuery can act -->
<style type="text/css">#widgets-left {display:none;}</style>
<script type="text/javascript">
// reload the contents of the iframe
function Reload () {
var f = document.getElementById('the-front-end');
f.src = f.src;
}
jQuery(document).ready( function($) {
// inject other content to fill the void
$('<div style="width:70%;"><input type="button" value="Reload front page" onclick="Reload();" style="float:right"><br /><iframe id="the-front-end" src="{$site}" frameborder="0" width="100%" height="700"></div>').insertBefore('#widgets-left');
// removes the whole left side of the widgets page
$('#widgets-left').remove();
});
</script>
HTML;
}
}
add_action('admin_footer-widgets.php', 'wpse_53398_script_printer');
Importante: la línea de cierre HTML;
no puede tener ningún espacio en blanco antes o después
PS: esta sintaxis de Heredoc <<<HTML code HTML;
impide que se muestre el código El PHP correctamente formateado aquí en WPSE. Pero el código está probado y funcionando.