Created
August 23, 2022 14:35
-
-
Save wpfullstripe/f4b8f8cbe4a264fec330150f260e4a2f to your computer and use it in GitHub Desktop.
Display extra content at the top of the customer portal pane.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A 'fullstripe_customer_portal_header' filter hook example for WP Full Stripe. | |
* | |
* @param string $content Header content set by a previous filter instance. | |
* @param array $params with the following keys: | |
* email => Email address of the logged-in customer | |
* stripeCustomerId => Stripe customer id of the logged-in customer | |
* stripeClient => Instance of the \StripeWPFS\StripeClient object, intialized in the API mode selected in the plugin's settings | |
* | |
* @return string Filtered content | |
*/ | |
function customerPortalHeader( $headerContent, $params ) { | |
$email = $params['email']; | |
$stripeCustomerId = $params['stripeCustomerId']; | |
$stripeClient = $params['stripeClient']; | |
$headerContent .= '<h3>Header</h3>'; | |
$headerContent .= '<p>Email: ' . $email . '</p>'; | |
$headerContent .= '<p>stripeCustomerId: ' . $stripeCustomerId . '</p>'; | |
return $headerContent; | |
} | |
add_filter( 'fullstripe_customer_portal_header', 'customerPortalHeader', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment