Changeset 13146 for trunk/wp-includes/general-template.php
- Timestamp:
- 02/14/2010 09:32:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/general-template.php
r13143 r13146 92 92 if ('' == locate_template($templates, true)) 93 93 load_template( get_theme_root() . '/default/sidebar.php'); 94 } 95 96 /** 97 * Load a generic template. 98 * 99 * Includes the named template for a theme or if a name is specified then a 100 * specialised template will be included. If the theme contains no {slug}.php file 101 * then no template will be included. 102 * 103 * For the parameter, if the file is called "{slug}-special.php" then specify 104 * "special". 105 * 106 * @uses locate_template() 107 * @since 3.0.0 108 * @uses do_action() Calls 'get_generic_template_{$slug}' action. 109 * 110 * @param string $slug The slug name for the generic template. 111 * @param string $name The name of the specialised template. 112 */ 113 function get_generic_template( $slug, $name = null ) { 114 do_action( "get_generic_template_{$slug}", $name ); 115 116 $templates = array(); 117 if ( isset($name) ) 118 $templates[] = "{$slug}-{$name}.php"; 119 120 $templates[] = "{$slug}.php"; 121 122 locate_template($templates, true); 94 123 } 95 124
Note: See TracChangeset
for help on using the changeset viewer.