Is it possible to create dynamic endpoint URLs?
add_rewrite_endpoint() only supports static endpoint names like trackback and recipes, so if you need a dynamic endpoint name/slug, then you would want to use add_rewrite_rule() instead. And just so that you know, even if add_rewrite_endpoint() did support dynamic names/slugs, your code would not work because your function runs too early (via the init hook) and … Read more