simple code problem in functions.php
-
Hi
in the functions.php
If I write this line of code, than it works and I get no admin bar for simple users:if (get_current_user_id() != ‘1’) {
add_filter(‘show_admin_bar’, ‘__return_false’);
}But if I put the line above in a function like this, nothing happens:
// Remove admin items
function optimize_editor() {if (get_current_user_id() != ‘1’) {
add_filter(‘show_admin_bar’, ‘__return_false’);}
add_action(‘admin_menu’,’optimize_editor’);I double checked (by using an echo) and the code inside the function is being called and the current user id is ‘2’.
– using “show_admin_bar(false);” yields the same results..
Thanks for any help!
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘simple code problem in functions.php’ is closed to new replies.