• 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

Viewing 2 replies - 1 through 2 (of 2 total)
  • does it make any difference to security or anything like that?

    I don’t think so, no.

    is there any real difference in using this code like that or putting it in a plugin?

    It really depends on your need. If you never want it there and are unlikely to change your theme, then in the theme is fine. If you want to be able to switch it on and off and persist if you change themes, then plugin is the way to go.

    Thread Starter bogski

    (@bogski)

    Thanks, that will do for me. I think i’ll try writing a plugin to see how it works.

    Thanks doubleedesign

    Bogski

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Disable the admin bar. Plugin Vs code in functions.php’ is closed to new replies.