Reorder a page of posts of a certain taxonomy/value by a custom field

Well, I did it like this. Maybe it will help someone.

add_filter( 'pre_get_posts', function () {
  global $wp_query;

  // article type - change posts per page. If webinars then change order to webinar_date
  if ( isset( $wp_query->query['article_type'] ) ) {
    set_query_var( 'posts_per_page', 12 );
    if ( $wp_query->is_tax('article_type', 'webinar') ) {
      $wp_query->set( 'meta_key', 'webinar_date' );
      $wp_query->set( 'orderby', 'meta_value' );
      $wp_query->set( 'order', 'DESC' );
    }
  }
} );