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 my Wordpress theme that I've currently been building I do not take advantage of the Wordpress Theme Customization API. As much as I would like too, I've invested far too much time into my own personal theme options framework for changing things.

This leads me to my question. How do I remove the blue, "Customize Your Site" button from the dashboard as well as link shown when viewing Appearance > Themes? I did some Googling, but my Google-Fu failed and couldn't find a solution that didn't use CSS or Javascript.

Ideally a hook to remove it would be best. But if there is no clean way to do so, a JS and or CSS solution would be fine.

share|improve this question
    
If you don't hook your Theme's options into the Theme Customizer, why would you need to hide the Theme Customizer entirely? It is a convenient way to modify Header, Background, Front Page display settings, Site Title and Tagline, etc. and preview those changes in real-time. So: why the need to remove it? Also: there's no reason you couldn't hook your "own personal theme options framework" into the Theme Customizer (and would provide a great benefit to your Theme users in the process). –  Chip Bennett Jan 21 '13 at 1:39
1  
I want to remove it because it is confusing. People assume they can change theme settings via this button but in my theme you can't. As good as the inbuilt theme customisation API is, it has limitations and is far from an out of the box solution. It can be extended of course, but I'm working off of a library that I built which supports things I'd have to code in support for via the new API of which would take considerable time to do so. –  DigitalSea Jan 21 '13 at 1:48
add comment

1 Answer

up vote 1 down vote accepted

There are no hooks to that part of the Dashboard.

It has to be done with CSS (or jQuery if you want to convert it in another thing).

add_action( 'admin_head-index.php', 'hide_customize_button_wpse_82424' );

function hide_customize_button_wpse_82424(){
    ?>
    <style type="text/css">div.welcome-panel-column:first-child {display:none;} </style>
    <?php
}

[update]

As pointed by @helenhousandi in a comment:

the wp_welcome_panel() function is added on the welcome_panel hook, but no, there are (purposefully) no hooks inside that function.

So, another approach is to remove the action hook and recreate the wp_welcome_panel() function, like so:

add_action( 'load-index.php', 'remove_welcome_panel' );
function remove_welcome_panel()
{
    remove_action( 'welcome_panel', 'wp_welcome_panel' );
    add_action( 'welcome_panel', 'my_welcome_panel' );
}

And my_welcome_panel is a replica of wp_welcome_panel() adapted as one wishes.

Please, also note her observation: my emphasis

I would suggest against having a publicly distributed theme remove it, though, because a user may come to expect that it's there. We found in user testing that many new users returned to that welcome panel even after getting acquainted.

share|improve this answer
    
Oh, that's a shame. Thank you very much for posting your solution, it works well! –  DigitalSea Jan 21 '13 at 4:30
    
Actually, the wp_welcome_panel() function is added on the welcome_panel hook, but no, there are (purposefully) no hooks inside that function. It's more a use it as is, replace it with what works better for you/client/whomever, or remove it kind of thing. I would suggest against having a publicly distributed theme remove it, though, because a user may come to expect that it's there. We found in user testing that many new users returned to that welcome panel even after getting acquainted. –  helenhousandi Jan 22 '13 at 23:37
    
@helenhousandi, thanks for the feedback! I've updated the Answer accordingly (:hopefully:). –  brasofilo Jan 23 '13 at 14:07
    
sorry to dig this up, but where would one have to add the code you posted in your answer? In the admin.php file or in functions.php of my theme? –  Octoshape Apr 8 at 13:22
add comment

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.