Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter davinian

    (@davinian)

    Anybody have any suggestions on how best todo this?

    Cheers,
    David

    This works, but throws an error in the log file…

    add_action( 'admin_init', 'hide_su_from_dashboard' );
    function hide_su_from_dashboard() {
        if ( !current_user_can( 'administrator' ) ) {
            // Remove Shortcodes-ultimate menus
            remove_menu_page( 'shortcodes-ultimate' );
        }
    }

    PHP Warning: Invalid argument supplied for foreach() in /var/www/sitename/htdocs/wp-admin/includes/plugin.php on line 1422

    Now if you research the error you will find that you need to change the hook from ‘admin_init’ to ‘admin_menu’. Indeed this does prevent the error, but it doesn’t hide the menu!

    WP 4.1

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

The topic ‘Remove/Hide Shortodes, Examples, Cheatsheet and Add-ons’ is closed to new replies.