0

I have created custom restore and permanently link in the custom column of the custom post type.

Restore and permanently delte link

I have created the restore and permanently delete using the following codes.

// Actions to delete.
        if ( $can_delete_post ) {
            if ( 'trash' !== $post->post_status ) {
                $actions['delete'] = '<a class="submitdelete" title="' . esc_attr( __( 'Move this item to the Trash' ) ) . '" href="' . get_delete_post_link( $post->ID ) . '">' . __( 'Trash', 'ims' ) . '</a>';
            } elseif ( 'trash' === $post->post_status ) {
                $restore_url            = wp_nonce_url( admin_url( 'post.php?post=' . $post->ID . '&action=untrash' ), 'untrash-post_' );
                $actions['untrash']     = '<a title="' . esc_attr( __( 'Restore customer', 'ims' ) ) . '" href="' . $restore_url . '">' . __( 'Restore', 'ims' ) . '</a>';
                $permanently_delete_url = wp_nonce_url( admin_url( 'post.php?post=' . $post->ID . '&action=delete' ), 'delete-post_' );
                $actions['delete']      = '<a class="submitdelete" title="' . esc_attr( __( 'Delete customer permanently' ) ) . '" href="' . $permanently_delete_url . '">' . __( 'Delete Permanently', 'ims' ) . '</a>';
            }
        }

But when I click the restore or permanently delete link, it shows the following error.

enter image description here

How can fix this problem? Please help me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.