Which works fine. However I wanted to add a choice for the user, so that I can add a permanent code block to my boilerplate theme, and allow users to toggle the admin bar off and on.

I have successfully added the toggle in the admin area, and called back the value successfully, however, when I test for the value in order to control the callback of the admin bar, the admin bar goes, but the CSS applied to the HTML element (margin-top: 28px !important;) remains, leaving a 28px gap in the top of my theme.

Here is the code block I am using to call the value back, and respond accordingly:

By requirement, my custom option (using register_setting) is not initialised until the admin_menu hook is launched, whilst the block_admin is launched on init. However, I don't think this is the issue as I don't think get_option is dependent on the setting being registered, but rather the option existing (or not) in the database.

I am sure the if statement is not the problem, as it does do something, and that something is reversible when I toggle the control back and forth. It removes the bar itself, just not the style applied to the html element.
–
Mild FuzzJul 19 '11 at 19:25