wp-api-plugins-themes-endpoints icon indicating copy to clipboard operation
wp-api-plugins-themes-endpoints copied to clipboard

Support theme slugs with `/` in the slug

Open danielbachhuber opened this issue 10 years ago • 2 comments

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.

danielbachhuber avatar Jan 30 '16 09:01 danielbachhuber

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

websupporter avatar Apr 26 '16 10:04 websupporter

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.

joehoyle avatar Aug 19 '16 09:08 joehoyle