How to Add a Delete Button to the WordPress Admin Bar

I came across this nice little piece of code recently at wpengineer.com. It adds a Delete button to your WordPress Admin Bar when you’re on a single post page. This lets you easily delete a post from your front end – very handy for some sites that end up doing a lot of deleting for one reason or another.

To use this, enter the following code into your functions.php file.  (Appearance > Edit > Theme Functions – functions.php)
function fb_add_admin_bar_trash_menu() {
global $wp_admin_bar;
if ( !is_super_admin() || !is_admin_bar_showing() )
return;
$current_object = get_queried_object();
if ( empty($current_object) )
return;
if ( !empty( $current_object->post_type ) &&

delete-small

Read more »