Getting the Donor ID for use on a page #7116
Replies: 3 comments 3 replies
-
Hey @rikk4444, to ensure I understand correctly, could you please share additional details about the intended use case for the donor id, or any specific outcomes that you are looking for? I'd like to get a better understanding what you're looking to achieve with it. Thanks! |
Beta Was this translation helpful? Give feedback.
-
hi @JoshuaHungDinh , yes sure! Thanks for replying. |
Beta Was this translation helpful? Give feedback.
-
@Rik44444 we don't have any official resources on extending the Donor Dashboard (that I know of), but I was able to reconstruct a starting point. You'll register a new "tab" on the donor dashboard during the The tab is represented as a class, which should extend With this tab class you can register routes (api endpoints) and enqueue assets, such as javascript that will render in that tab. I'll have to do some more digging from there, since this isn't something that is documented, yet. That said, this should be a good place to start. <?php
add_action('init', function() {
(new \App\CustomTab)->registerTab();
}); <?php
namespace App;
class CustomTab extends \Give\DonorDashboards\Tabs\Contracts\Tab
{
public static function id() {
return 'custom-tab';
}
public function routes() {
return [
MyCustomTabRoute::class, // Must extend \Give\DonorDashboards\Tabs\Contracts\Route
];
}
public function enqueueAssets()
{
// Enqueue assets here
}
} |
Beta Was this translation helpful? Give feedback.
-
We are trying to build an extra tab for the Donor Dashboard. For this, we need to use GiveWP's Donor ID as a parameter in on a page. In what way can we get hold of this Donor ID on a Wordpress page? We've noted that there is a unique key in the URL for GiveWP users in the URL, could we get this key somehow? And then via the key get the Donor ID?
Beta Was this translation helpful? Give feedback.
All reactions