How do I change option name? I have sort link 'Best' in exposed form. I want after user click this link, link title changes to 'New'
I'm try this, but it don't work:
function helper_form_views_exposed_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id) {
    if($form['#id']== 'views-exposed-form-pozdravleniya-taxonomy-term-page-1') {
      $form['sort_by']['#title'] = '';
      $form['sort_by']['#options']['created'] = '';
      if ($form['sort_by']['#value'] == 'count') {
        $form['sort_by']['#options']['count'] = 'New';
      }
    }
}

Also I'm try this, it don't work too:
function helper_form_views_exposed_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id) {
    if($form['#id']== 'views-exposed-form-pozdravleniya-taxonomy-term-page-1') {
      $form['sort_by']['#title'] = '';
      $form['sort_by']['#options']['created'] = '';
      if ($form_state-&gt;getValue('sort_by') == 'count') {
        $form['sort_by']['#options']['count'] = 'New';
      }
    }
}
I get answer here https://stackoverflow.com/a/65888182/13738862
function helper_form_views_exposed_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id) {
    if($form['#id']== 'views-exposed-form-pozdravleniya-taxonomy-term-page-1') {
      $form['sort_by']['#title'] = '';
      $form['sort_by']['#options']['created'] = '';
      if ($form_state-&gt;getUserInput()['sort_by'] == 'count') {
        $form['sort_by']['#options']['count'] = 'New';
      }
    }
}