Automatically assign posts with custom field to taxonomy term

The following should do what you need:

add_action ('save_post_site-members', 'add_term') ;

function
add_term ($post_id)
{
    if (defined ('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
        return ;
        }

    $meta_key = 'aab-ew-select-visible' ;
    $tax = 'test-all-members-cpt-tax' ;
    $term_slug = 'test-all-members-ew-tax' ;

    $meta_value = isset ($_REQUEST[$meta_key]) ? $_REQUEST[$meta_key] : '' ;
    if ('display' == $meta_value) {
        $term = get_term_by ('slug', $term_slug, $tax) ;
        if ($term) {
            wp_set_object_terms ($post_id, $term->term_id, $tax, true) ;
            }
        }

    return ;
}

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