Disable the admin bar. Plugin Vs code in functions.php
-
Hello!
I’ve just installed a WordPress website on my local machine to have a play around with new WordPress RC. I found a piece of code to hide the the admin bar in the header of the website which works cool.
This is the code `/*Disable WordPress Toolbar from header*/
add_filter(‘show_admin_bar’, ‘__return_false’);`I have pasted this directly into the functions.php of my child theme and it works great.
Whilst searching for that code i noticed there were a few plugins to do the same thing. Now i’ve been looking into writing a plugin for word press and thought this might be a simple one to start with.
The question is though, is there any real difference in using this code like that or putting it in a plugin? does it make any difference to security or anything like that?
Edit: I should mention i wasnt able to select the version im using from the drop down. I am using the latest RC for WP 4.5
Many thanks
Bogski
The topic ‘Disable the admin bar. Plugin Vs code in functions.php’ is closed to new replies.