Reply To: Change url easy-rooms

Is it possible to add a rewrite rule in your theme’s functions.php file, instead of modyfying the plugin files on each update? Something like this:

add_action('init','easyrooms_add_alias');
function easyrooms_add_alias(){
add_rewrite_rule('myalias/([^/]+)/?', 'index.php?post_type=easy-rooms&easy-rooms=$matches[1]', 'top' );
}