WordPress.org

Make WordPress Core

Ticket #13265: theme.php.diff

File theme.php.diff, 653 bytes (added by nathanrice, 4 years ago)
  • theme.php

     
    164164 * @return array Key is template name, Value is template name 
    165165 */ 
    166166function get_page_templates() { 
     167        /* Allow a plugin to short-circuit this function */ 
     168        $pre = apply_filters('pre_get_page_templates', false); 
     169        if( $pre ) return $pre; 
     170         
    167171        $themes = get_themes(); 
    168172        $theme = get_current_theme(); 
    169173        $templates = $themes[$theme]['Template Files']; 
     
    191195                } 
    192196        } 
    193197 
    194         return $page_templates; 
     198        return apply_filters('page_templates', $page_templates, $templates); 
    195199} 
    196200 
    197201/**