Ticket #18480: general-template.patch
| File general-template.patch, 1.5 KB (added by gxxaxx, 21 months ago) |
|---|
-
general-template.php
70 70 * Includes the sidebar template for a theme or if a name is specified then a 71 71 * specialised sidebar will be included. 72 72 * 73 * For the parameter, if the file is called "sidebar-special.php" then specify 74 * "special". 73 * The parameter maybe a simple text string such as: 74 * For the parameter, if the file is called "sidebar-special.php" then specify 75 * "special". 75 76 * 77 * Or, the parameter maybe an array of strings such as: ("mefirst", "mesecond", "special") 78 * In this case the sidebar search order would be: 79 * "sidebar-mefirst.php" 80 * "sidebar-mesecond.php" 81 * "sidebar-special.php" 82 * 76 83 * @uses locate_template() 77 84 * @since 1.5.0 78 85 * @uses do_action() Calls 'get_sidebar' action. … … 83 90 do_action( 'get_sidebar', $name ); 84 91 85 92 $templates = array(); 86 if ( isset($name) )87 $templates[] = "sidebar-{$name}.php";88 93 94 if ( isset($name) ) { 95 if (is_array($name)) { 96 foreach ( (array) $name as $disname ) { 97 if ( !$disname ) { continue; } 98 $templates[] = "sidebar-{$disname}.php"; 99 } 100 } else { 101 $templates[] = "sidebar-{$name}.php"; 102 } 103 } 104 89 105 $templates[] = 'sidebar.php'; 90 106 91 107 // Backward compat code will be removed in a future release … … 93 109 load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php'); 94 110 } 95 111 112 96 113 /** 97 114 * Load a template part into a template 98 115 *
