Last active
February 19, 2025 08:44
-
-
Save andrewlimaza/3f5198d9c6a45ce27d5cfa5b07c75dd0 to your computer and use it in GitHub Desktop.
Custom !!denied_reason!! for Approvals Denied Email Templates.
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 | |
/** | |
* Add a custom field !!denied_reason!! to be used in Approvals Denied Email. | |
* Add this code to your site by following this guide - https://www.paidmembershipspro.com/create-a-plugin-for-pmpro-customizations/ | |
*/ | |
function my_pmpro_denied_message( $data, $member ) { | |
$denied_reason = get_user_meta( $member->ID, 'my_field_key', true ); // Change 'my_field_key' to the meta key of your custom field. | |
$data['denied_reason'] = $denied_reason; | |
return $data; | |
} | |
add_filter( 'pmpro_approvals_member_denied_email_data', 'my_pmpro_denied_message', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment