Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: Viper007Bond on Aug 4th, 2011  |  syntax: PHP  |  size: 0.57 KB  |  hits: 99  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
This paste has a previous version, view the difference. Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. ?>