View difference between Paste ID: 7KgqUXR5 and
SHOW:
|
|
- or go back to the newest paste.
1 | - | |
1 | + | <?php |
2 | ||
3 | function get_sidebar( $name = null, $subfolder = null ) { | |
4 | do_action( 'get_sidebar', $name ); | |
5 | ||
6 | $templates = array(); | |
7 | ||
8 | if ( ! empty( $subfolder ) ) { | |
9 | if ( isset( $name ) ) | |
10 | $templates[] = "$subfolder/sidebar-{$name}.php"; | |
11 | ||
12 | $templates[] = "$subfolder/sidebar.php"; | |
13 | } | |
14 | ||
15 | if ( isset( $name ) ) | |
16 | $templates[] = "sidebar-{$name}.php"; | |
17 | ||
18 | $templates[] = 'sidebar.php'; | |
19 | ||
20 | // Backward compat code will be removed in a future release | |
21 | if ('' == locate_template($templates, true)) | |
22 | load_template( ABSPATH . WPINC . '/theme-compat/sidebar.php'); | |
23 | } | |
24 | ||
25 | ?> |