[wp-trac] [WordPress Trac] #31620: get_raw_theme_root does not resolve custom theme folder when is the unique

WordPress Trac noreply at wordpress.org
Tue Feb 3 15:43:05 UTC 2026


#31620: get_raw_theme_root does not resolve custom theme folder when is the unique
-----------------------------------------+------------------------------
 Reporter:  giuseppe.mazzapica           |       Owner:  (none)
     Type:  defect (bug)                 |      Status:  new
 Priority:  normal                       |   Milestone:  Awaiting Review
Component:  Themes                       |     Version:  3.1
 Severity:  normal                       |  Resolution:
 Keywords:  has-patch reporter-feedback  |     Focuses:
-----------------------------------------+------------------------------
Changes (by huzaifaalmesbah):

 * keywords:  has-patch needs-testing reporter-feedback => has-patch
     reporter-feedback


Comment:

 === Patch Testing Report

 Patch Tested: [attachment:"31620.3.patch"]

 === Environment
 - WordPress: 7.0-alpha-61215-src
 - PHP: 8.2.30
 - Server: nginx/1.29.4
 - Database: mysqli (Server: 9.5.0 / Client: mysqlnd 8.2.30)
 - Browser: Chrome 144
 - OS: macOS
 - Theme: Twenty Twenty-Four 1.4
 - MU Plugins:
   * custom-theme-dir.php
 - Plugins:
   * Classic Editor 1.6.7
   * Test Reports 1.2.1

 === Steps taken
 1. Created custom directory: wp-content/test-themes
 2. Moved theme "twentytwentyfour" into that directory
 3. Removed default wp-content/themes directory entirely
 4. Added MU plugin:
 {{{
  register_theme_directory( WP_CONTENT_DIR . '/test-themes' );
    var_dump( get_raw_theme_root( 'twentytwentyfour' ) );
 }}}

 5. Applied 31620.3.patch
 6. Tested after patch
    - get_raw_theme_root() returned: /test-themes
    - Theme detected correctly
    - Theme activates and loads normally
    - No broken paths or URL issues
    - ✅ Patch is solving the problem

 === Expected result
 When only one theme directory is registered, WordPress should use that
 directory instead of always returning /themes.


 === Screenshots/Screencast
 https://files.catbox.moe/f84zvn.mp4

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/31620#comment:18>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list