Import and display GitHub bounties within a WordPress site.
- Copy contents of
functions.php
to your theme'sfunctions.php
file. - Change repository API URL in
wpb_get_bounties_data()
function (line 8functions.php
). - Enqueue Alpine.js in your theme.
- Add to CSS:
[x-cloak] { display: none; }
(required by Alpine) - Copy
bounties()
JS function to your scripts. - Modify markup and add styles to suit your needs.
- The GitHub returns up to 100 issues by default. If you need to do more you will need to update
wpb_get_bounties_data()
to get all pages of data. - Title format for bounty issues should be
[issue title] | Bounty: [bounty value]
. We split the string with| Bounty:
.