/** Give User Role Editor to Access All Media */
function give_user_role_editor_to_access_all_media() {
/* Check if user is editor role or not */
if ( in_array( 'editor', (array) wp_get_current_user()->roles ) && ! current_user_can( 'manage_options' ) ) {
/* For Show ALl Media in Grid View */