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.

I'd like to make the back-end of the SlideDeck 2 plugin visible for admin users only.
Also, I'd like to remove that "Insert SlideDeck" button from the editor.

How can I do this?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Put the following in your functions.php:

if (is_admin() && ! current_user_can('install_plugins')) {
    add_action('admin_init', 'remove_slidedeck_menu_page');
    add_action('admin_footer', 'remove_slidedeck_media_button');
}

// remove the menu page
function remove_slidedeck_menu_page() {
    remove_menu_page('slidedeck2-lite.php');
}

// remove the button
function remove_slidedeck_media_button() {
    echo <<<JQUERY
<script>
jQuery(document).ready(function($) {
    $('#add_slidedeck').remove();
});
</script>
JQUERY;
}

Note: I did test this. If something doesn't work for you, please report back. If it does, please come back as well (and vote up/accept). ;)

// EDIT: the menu page is now working.

// EDIT 2: the button as well.

share|improve this answer
1  
Bro Cool its worked now!! :D You really rockz....But sorry :( i don't have 15 reputation to +1 this answer!! :( –  bless Apr 19 '13 at 20:11
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.