WordPress.org

Make WordPress Core

Ticket #10067: 10067-with-theme-folder.patch

File 10067-with-theme-folder.patch, 672 bytes (added by bforchhammer, 5 years ago)

returns path relative to themes folder

  • wp-includes/theme.php

     
    11531153        $file = preg_replace('|/+|','/', $file); // remove any duplicate slash 
    11541154        $theme_dir = str_replace('\\','/', get_theme_root()); // sanitize for Win32 installs 
    11551155        $theme_dir = preg_replace('|/+|','/', $theme_dir); // remove any duplicate slash 
    1156         $file = preg_replace('|^.*/themes/.*?/|','',$file); // get relative path from theme dir 
     1156        $file = preg_replace('#^'. preg_quote($theme_dir, '#') .'/#','',$file); // get relative path from theme dir 
    11571157        return $file; 
    11581158} 
    11591159