Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

In the profile.php admin page there is a checkbox for the Toolbar: Show Toolbar when viewing site.

I can't seem to find where this option is stored in the database. I would have thought it would be in the wp_usermeta table ... but I don't see it.

My goal is to set the default value of this to "off" for new users. Then, of course, they would have the option to turn it on if they wanted.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

You can update the usermeta upon user registration.

Try adding this to functions.php and then adding a new user:

add_action('user_register', 'update_usermeta_bar', 10, 1);

function update_usermeta_bar($user_id)
{

    update_user_meta($user_id, 'show_admin_bar_front', "false");
}
share|improve this answer
    
That's so strange -- I feel like this should work but it is still being set to true after registration ... I wonder if WP is setting this user_meta field after the user_register hook is called and overwriting what we put there. Because my other update_user_meta calls are working in the same place. –  thornomad Feb 26 at 18:57
    
I got it: false had to be in quotes ... otherwise I don't think it's storing the actual value 'false': update_user_meta($user_id, 'show_admin_bar_front', 'false'); –  thornomad Feb 26 at 19:04
    
I believe any value other than "true" should work. I will update my answer. –  gdaniel Feb 26 at 19:16

In the usermeta table, there is a key called "show_admin_bar_front" Try this query:

SELECT * FROM wp_usermeta WHERE meta_key LIKE 'show_admin_bar_front'

share|improve this answer
    
There it is -- I don't know why I didn't see that the first time I looked. Need glasses. Thanks. –  thornomad Feb 26 at 18:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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