Advertisement
Viper007Bond

Untitled

Aug 4th, 2011
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  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. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement