Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#54349 closed defect (bug) (fixed)

Themes controller does not handle themes in nested directories

Reported by: timothyblynjacobs's profile TimothyBlynJacobs Owned by: timothyblynjacobs's profile TimothyBlynJacobs
Milestone: 5.9 Priority: normal
Severity: normal Version: 5.7
Component: REST API Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

WordPress supports nesting themes inside a directory to essentially have a theme "bundle". This is used, for example, by the Theme Experiments repo.

In WordPress 5.7 we added support for the Themes controller to query information for a specific theme, #50152. However, the Regex used to identify the theme stylesheet does not allow for a /, meaning these nested themes cannot be addressed by the REST API.

Reported in https://github.com/WordPress/gutenberg/pull/35985.

Change History (4)

This ticket was mentioned in PR #1793 on WordPress/wordpress-develop by TimothyBJacobs.


3 years ago
#1

  • Keywords has-patch has-unit-tests added

This allows for themes that are included inside of a subdirectory, for example subdir/my-theme, to be accessed via the single item route of the wp/v2/themes controller.

Fixes #35985.

Trac ticket: https://core.trac.wordpress.org/ticket/54349

#2 @TimothyBlynJacobsCore Committer
3 years ago

  • Owner set to TimothyBlynJacobs
  • Status changed from new to assigned

This copies the same handling from the Plugins controller, which has a similar situation where a plugin can either be a single-file plugin or inside a directory.

This ticket was mentioned in Slack in #core-restapi by spacedmonkey. View the logs.


3 years ago

#4 @TimothyBlynJacobsCore Committer
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 52017:

REST API: Support subdirectory themes in the Themes controller.

This allows for themes that are included inside of a subdirectory, for example subdir/my-theme, to be accessed via the single item route of the /wp/v2/themes controller.

Fixes #54349.

Note: See TracTickets for help on using tickets.