Or rather, call sanitize_title_with_dashes(), and construct the $templates array later, instead of constructing and then destructuring it.