您必须使用gettext过滤器,因为没有与您的请求关联的挂钩或过滤器。
function custom_user_message($translation, $text){
if(\'Profile updated.\' == $text){
$current_user = wp_get_current_user();
$foo_condition = \'\'; //Do some checking here for user custom field
if(!$foo_condition)
return $text.\' Custom Message\';
}
return $translation;
}
add_filter( \'gettext\', \'custom_user_message\', 10, 2 );