WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 5 weeks ago

#54349 closed defect (bug) (fixed)

Themes controller does not handle themes in nested directories

Reported by: TimothyBlynJacobs Owned by: 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.


6 weeks ago

  • 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 @TimothyBlynJacobs
6 weeks 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.


5 weeks ago

#4 @TimothyBlynJacobs
5 weeks 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.