Skip to content
This repository has been archived by the owner on Aug 15, 2019. It is now read-only.

Support theme slugs with / in the slug #13

Open
danielbachhuber opened this issue Jan 30, 2016 · 2 comments
Open

Support theme slugs with / in the slug #13

danielbachhuber opened this issue Jan 30, 2016 · 2 comments

Comments

@danielbachhuber
Copy link
Member

One thing to be aware of is that themes can be installed in subdirectories of themes, for instance wp-content/themes/free/my-awesome-theme. As such, we'll need to somehow support themes where a / could be in the slug.

@websupporter
Copy link
Member

Wouldn't this do the trick:
register_rest_route( $this->namespace, '/' . $this->rest_base . '/(?P<slug>[\w-|\/]+)

@joehoyle
Copy link
Member

hmm I don't know if / is a valid slug character. While this is possible in wordpress, a slug almost by definition should not have a / in it - maybe we'd have to transform it in the response and somehow on input too, but keeping a slash in the url is going to be mightily confusing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants