Skip to content

Instantly share code, notes, and snippets.

@LinzardMac
Created June 21, 2012 00:41
Show Gist options
  • Save LinzardMac/2963181 to your computer and use it in GitHub Desktop.
Save LinzardMac/2963181 to your computer and use it in GitHub Desktop.
function msmb_delete( $atts ) {
global $post;
get_currentuserinfo();
if (current_user_can('edit_post')) {
$deleteme = "<a href='" . wp_nonce_url(get_bloginfo('url').'/wp-admin/post.php?post='.$post->ID.'&amp;action=trash', 'delete-post_' . $post->ID) . "'>Delete</a>";
}
return $deleteme;
}
add_shortcode( 'delete_button', 'msmb_delete' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment