将以下内容放入functions.php
:
if (! empty($GLOBALS[\'pagenow\']) && \'post.php\' === $GLOBALS[\'pagenow\'])
add_action(\'admin_footer\', \'trash_click_error\');
function trash_click_error() {
echo <<<JQUERY
<script>
jQuery(function($) {
$(\'#delete-action a\').unbind();
$(\'#delete-action a\').click(function(event) {
event.preventDefault();
alert(\'Error!\');
setTimeout(
function() {
$(\'#save-action .spinner\').hide();
$(\'#publish\').removeClass(\'button-primary-disabled\');
},
1
);
});
});
</script>
JQUERY;
}