How to disable controls in theme customizer?

I have not tested this yet but plan to do something similar soon..

If you want to completely remove the default control you can use this code. You can find the appropriate control id to use in place of ‘display_header_text’ by searching for the correct one that matches the control you wish to target in wp-includes/class-wp-customize-manager.php

$wp_customize->remove_control('display_header_text');

Display_header_text is the checkbox which toggles whether or not Site title and tagline are displayed.

If (for example) you want to actually hide the Site title textbox control in the theme customizer when display_header_text is checked you can do something like this..

if( get_theme_mod( 'display_header_text' ) !== '') {
    $wp_customize->remove_control('blogname');
} else {
    $wp_customize->add_setting( 'blogname', array(
        'default' => 'default_value',
    ) );
    $wp_customize->add_control( 'blogname', array(
        'label'   => 'Title',
        'section' => 'title_tagline',
        'type'    => 'text',
        'priority' => 1
    ) );
}

The theme customizer stores the value of a checkbox as the numeral 1 if it is checked and blank if it isn’t checked. So the code above says if the checkbox which controls whether or not site title and subtitle are displayed, is not empty then remove the site title textbox so the option to enter a site title won’t even be available. But if the checkbox is empty, display the textbox.