added check for logged in user in filter email
This commit is contained in:
@@ -34,9 +34,10 @@ add_filter('df_notification_body', 'filter_email_fb_CIPF', 10, 2); // the admini
|
|||||||
* callback to provide the user info corresponding to the $$key_word$$
|
* callback to provide the user info corresponding to the $$key_word$$
|
||||||
*/
|
*/
|
||||||
function replace_words_CIPF($matches) {
|
function replace_words_CIPF($matches) {
|
||||||
|
error_log("in replace_words_CIPF");
|
||||||
|
if (!is_user_logged_in())
|
||||||
|
return "";
|
||||||
$current_user = wp_get_current_user();
|
$current_user = wp_get_current_user();
|
||||||
if ($current_user->ID === 0)
|
|
||||||
return "[no user logged in]";
|
|
||||||
$query = $matches[1];
|
$query = $matches[1];
|
||||||
$result = $current_user->$query;
|
$result = $current_user->$query;
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
Reference in New Issue
Block a user