0

i am looking for solution to show always welcome panel in the dashboard by php code. i know that for every user this parameter is stored in DB.

the question is, how can i check if the login user don't see the "welcome panel", and the check box is not checked, to show the welcome panel, how to make this box be checked by php code and to save this in DB so next time the user will login and see right away the welcome panel.

any suggestions?

enter image description here

  • Here on the right in the Related sidebar, there are few questions that could be useful to you, did you check them out? For example this one. Do you want to make the Welcome panel sticky and always show it, no matter what the users do? Or did have another setup in mind? – birgire Dec 6 '14 at 8:12
3

thanks @birgire with your help i change the code to make this work.

everyone that looking for the same solution you can use this code:

 add_action( 'load-index.php', 'show_welcome_panel' );

function show_welcome_panel() {
    $user_id = get_current_user_id();

    if ( 1 != get_user_meta( $user_id, 'show_welcome_panel', true ) )
        update_user_meta( $user_id, 'show_welcome_panel', 1 );
}

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.