get_delete_post_link example

do_action( 'post_submitbox_start', $post );
    ?> <div id="delete-action"> <?php         if ( current_user_can( 'delete_post', $post_id ) ) {
            if ( ! EMPTY_TRASH_DAYS ) {
                $delete_text = __( 'Delete permanently' );
            } else {
                $delete_text = __( 'Move to Trash' );
            }
            ?> <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post_id ); ?>"><?php echo $delete_text; ?></a> <?php         }
        ?> </div> <div id="publishing-action"> <span class="spinner"></span> <?php         if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ), true ) || 0 === $post_id ) {
            if ( $can_publish ) :
                if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
                    
if ( 'trash' === $post->post_status ) {
                $actions['untrash'] = sprintf(
                    '<a href="%s" aria-label="%s">%s</a>',
                    wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&amp;action=untrash', $post->ID ) ), 'untrash-post_' . $post->ID ),
                    /* translators: %s: Post title. */
                    esc_attr( sprintf( __( 'Restore &#8220;%s&#8221; from the Trash' )$title ) ),
                    __( 'Restore' )
                );
            } elseif ( EMPTY_TRASH_DAYS ) {
                $actions['trash'] = sprintf(
                    '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
                    get_delete_post_link( $post->ID ),
                    /* translators: %s: Post title. */
                    esc_attr( sprintf( __( 'Move &#8220;%s&#8221; to the Trash' )$title ) ),
                    _x( 'Trash', 'verb' )
                );
            }

            if ( 'trash' === $post->post_status || ! EMPTY_TRASH_DAYS ) {
                $actions['delete'] = sprintf(
                    '<a href="%s" class="submitdelete" aria-label="%s">%s</a>',
                    get_delete_post_link( $post->ID, '', true ),
                    /* translators: %s: Post title. */
                    
Home | Imprint | This part of the site doesn't use cookies.