Media Upload not working after hiding some elements from functions.php

Replace your code with this code:-

add_action('wp_footer', 'myCssCode', PHP_INT_MAX);
function myCssCode() {
    ?>
    <style> 
        #toplevel_page_wpcf7, 
        #wp-admin-bar-wp-logo,
        #screen-meta-links,
        #menu-tools,
        #wp-admin-bar-wpseo-menu,
        #footer-upgrade,
        #toplevel_page_wpfront-user-role-editor-all-roles,
        #toplevel_page_vc-general,
        #menu-settings,
        #toplevel_page_wpseo_dashboard,
        #toplevel_page_revslider,
        #toplevel_page_themepunch-google-fonts,
        #menu-appearance,
        #wp-admin-bar-snap-post,
        .error
        {
            display:none;
        }
    </style>
    <?php
}

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)