' . esc_html__( 'Security check failed. Please try again.', 'subscription' ) . '
';
wp_die();
}
// Clean all trash items.
$trash_posts = get_posts(
[
'post_type' => 'subscrpt_order',
'post_status' => 'trash',
'numberposts' => -1,
'fields' => 'ids',
]
);
foreach ( $trash_posts as $trash_id ) {
wp_delete_post( $trash_id, true );
}
wp_safe_redirect( admin_url( 'admin.php?page=wp-subscription&subscrpt_status=trash' ) );
exit;
} else {
// For other actions, verify nonce with subscription ID.
$nonce_action = 'wpsubs_action_' . $sub_id;
if ( ! wp_verify_nonce( $nonce, $nonce_action ) ) {
echo '