[wp-trac] [WordPress Trac] #11121: get_page_templates inconsistent use capitals

WordPress Trac wp-trac at lists.automattic.com
Wed Nov 11 11:21:38 UTC 2009


#11121: get_page_templates inconsistent use capitals
----------------------------+-----------------------------------------------
 Reporter:  rvdk            |       Owner:                                 
     Type:  defect (bug)    |      Status:  new                            
 Priority:  normal          |   Milestone:  Unassigned                     
Component:  Administration  |     Version:  2.8.5                          
 Severity:  normal          |    Keywords:  2nd-opinion, get_page_templates
----------------------------+-----------------------------------------------
 I noticed this when using the Flutter plugin.

 Somehow I did not get the templates I generated any more. For the record
 my template name was: Commond

 I discovered that the following file/function was the problem:
 /wp-admin/includes/theme.php line: 125 - 128

 $themes = get_themes();
 Returns an associated array with theme names in lowercase

 $theme = get_current_theme();
 retrieved the name with a capital C

 Thus:
 $templates = $themes[$theme]['Template Files'];
 resulted in null.

 By changing line 126 to:
 $theme = strtolower(get_current_theme());

 I managed to solve this issue.

 Please verify.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/11121>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list