added check for logged in user in filter email

This commit is contained in:
asus
2024-03-05 10:44:36 +01:00
parent 39c9f492dc
commit 620aa9329b

View File

@@ -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$$
*/
function replace_words_CIPF($matches) {
error_log("in replace_words_CIPF");
if (!is_user_logged_in())
return "";
$current_user = wp_get_current_user();
if ($current_user->ID === 0)
return "[no user logged in]";
$query = $matches[1];
$result = $current_user->$query;
return $result;