Chèn nút xoá nhanh tại Menu Bar


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 ) &&
    ( $post_type_object = get_post_type_object( $current_object->post_type ) ) &&
    current_user_can( $post_type_object->cap->edit_post, $current_object->ID )
    ) {
        $wp_admin_bar->add_menu(
            array( 'id' => 'trash',
        		'title'  => '<span class="dashicons dashicons-trash" style="font: normal 18px/1 \'dashicons\';-webkit-font-smoothing: antialiased;   padding-right: 6px; margin-top: 6px;"></span> '.__( 'Move to Trash'),
                'href' => wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?post=" . $current_object->ID.
"&amp;action=trash", 'trash-post_' . $current_object->ID) 
                //'href' => get_delete_post_link($current_object->term_id)
            )
        );
        $wp_admin_bar->add_menu(
            array( 'id' => 'delete',
        		'title'  => '<span class="dashicons dashicons-no" style="font: normal 18px/1 \'dashicons\';-webkit-font-smoothing: antialiased;   padding-right: 6px; margin-top: 6px;"></span> '.__( 'Delete Permanently'),
                'href' => wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?post=" . $current_object->ID.
"&amp;action=delete", 'delete-post_' . $current_object->ID) 
            )
        );
    }
}
add_action( 'admin_bar_menu', 'fb_add_admin_bar_trash_menu', 100 );