Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wp_delete_post_link($link = 'Delete This', $before = '', $after = '', $title="Move this item to the Trash", $cssClass="delete-post") {
- global $post;
- if ( $post->post_type == 'page' ) {
- if ( !current_user_can( 'edit_page' ) )
- return;
- } else {
- if ( !current_user_can( 'edit_post' ) )
- return;
- }
- $delLink = wp_nonce_url( site_url() . "/wp-admin/post.php?action=trash&post=" . $post->ID, 'trash-' . $post->post_type . '_' . $post->ID);
- $link = '<a class="' . $cssClass . '" href="' . $delLink . '" onclick="javascript:if(!confirm('Are you sure you want to move this item to trash?')) return false;" title="'.$title.'" />'.$link."</a>";
- return $before . $link . $after;
- }
Add Comment
Please, Sign In to add comment