I have added new fields on the user profile page.

I want to display a message that says: "It's good ... or not"

I couldn't find a hook in the WordPress codex.

I don't want to use a plugin only my own code I want change this code :

<div id="message" class="updated">
    <p><strong>Updated profile </strong></p>

You will have to use a gettext filter as there are no hooks or filters associated with your request.

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
            return $text.' Custom Message';
    return $translation;
add_filter( 'gettext', 'custom_user_message', 10, 2 );
|improve this answer|||||

I know this is old but it could help others. There is actually an action to use with this: admin_notices. Here is the link to it on the Codex

Here is how you would use it:

function my_admin_notice(){
    echo '<div class="updated">
       <p>Aenean eros ante, porta commodo lacinia.</p>
add_action('admin_notices', 'my_admin_notice');
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.