URL rewrite – How to replace the registered taxonomy URL of the provider plugin in the child theme

In a provider plugin, I got this:

        register_taxonomy( 'listing-region', 'listing', array( 'rewrite' => false, 'hierarchical' => true, 'label' => __( 'Regions', 'bt_plugin' ), 'singular_name' => __( 'Region', 'bt_plugin' ), 'show_admin_column' => true ) );

To avoid locking the plugin update, I would like to overwrite the & # 39; rewrite & # 39; in the child theme to get this:

https://www.myexample.com/region/foo <=> https://www.myexample.com?listing-region=foo

How can I do this?

For now, I have tried this in functions.php:

function theme_child_custom_rewrite() {
    //Ensure the $wp_rewrite global is loaded
    global $wp_rewrite;
    //Call flush_rules() as a method of the $wp_rewrite object
    $wp_rewrite->flush_rules( false );
    add_rewrite_tag('%listing-region%','((^&)+)');
    add_rewrite_rule('^region/(.*?)$', 'index.php?listing-region=$matches(1)', 'top');
}
add_action('init','theme_child_custom_rewrite', 1000);

function listing_region_term_link( $post_link, $id = 0 ){
    $post = get_post($id);
    if ( is_object( $post ) ){
        $terms = wp_get_object_terms( $post->ID, 'course' );
        if( $terms ){
            return str_replace( '%listing-region%' , $terms(0)->slug , $post_link );
        }
    }
    return $post_link;
}
add_filter( 'term_link', 'listing_region_term_link', 1, 3 );