Skip to content

Instantly share code, notes, and snippets.

@plugin-republic
Last active October 26, 2020 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/649c969b6255f3b2cc9fa7ac58345642 to your computer and use it in GitHub Desktop.
Save plugin-republic/649c969b6255f3b2cc9fa7ac58345642 to your computer and use it in GitHub Desktop.
Filter the content of the user approval and rejection messages
<?php
/**
* Filter the content of the user approval message
* @param $message The message content
* @param $url The url to redirect the user to
* @param $user The user object
*/
function prefix_user_approval_message( $message, $url, $user ) {
$message = 'My new message goes here';
return $message;
}
add_filter( 'wcmo_user_approval_message', 'prefix_user_approval_message', 10, 3 );
/**
* Filter the content of the user rejection message
* @param $message The message content
* @param $url The url to redirect the user to
* @param $user The user object
*/
function prefix_user_rejection_message( $message, $url, $user ) {
$message = 'My new message goes here';
return $message;
}
add_filter( 'wcmo_user_rejection_message', 'prefix_user_rejection_message', 10, 3 );
/**
* Filter the subject
* @param $subject The subject
*/
function prefix_user_approval_rejection_subject( $subject ) {
$subject = 'My new subject goes here';
return $subject;
}
add_filter( 'wcmo_user_approval_rejection_subject', 'prefix_user_approval_rejection_subject' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment