THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

How to Build a Bitcoin Donation Shortcode for WordPress

permalink THAMER
#bitcoin#ghost#payments#wordpress

Save the PHP file as a small plugin with a Plugin Name header, activate it in a staging WordPress installation and insert [bitcoin_donate] in a Shortcode block. Replace the placeholder URL with your HTTPS donation page. The callback returns markup rather than printing it. The fixed URL avoids arbitrary shortcode-supplied destinations.

Source code

PHP · 8 lines
1<?php
2function stage25_donation_shortcode(): string {
3    return '<a href="https://example.org/donate">Donate Bitcoin</a>';
4}
5if (function_exists('add_shortcode')) {
6    add_shortcode('bitcoin_donate', 'stage25_donation_shortcode');
7}
8if (PHP_SAPI === 'cli' && !str_contains(stage25_donation_shortcode(), 'https://example.org/donate')) exit(1);

Validation and deployment

Use a staging site and testnet first. Verify the destination, test duplicate payment notifications and keep fulfillment separate from browser requests. This example was checked locally, not inside a live CMS.

Related documentation

https://thamer.org/api

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects