[wp-cvs] wordpress/wp-includes template-functions-general.php, 1.39, 1.40

Ryan Boren rboren at users.sourceforge.net
Wed Jul 28 03:30:18 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22888

Modified Files:
	template-functions-general.php 
Log Message:
Fix wp_title() display of category_name.

Index: template-functions-general.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-general.php,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** template-functions-general.php	28 Jul 2004 02:43:54 -0000	1.39
--- template-functions-general.php	28 Jul 2004 03:30:15 -0000	1.40
***************
*** 99,103 ****
  function wp_title($sep = '»', $display = true) {
      global $wpdb;
!     global $m, $year, $monthnum, $day, $cat, $p, $name, $month, $posts;
  
      // If there's a category
--- 99,103 ----
  function wp_title($sep = '»', $display = true) {
      global $wpdb;
!     global $m, $year, $monthnum, $day, $cat, $category_name, $p, $name, $month, $posts;
  
      // If there's a category
***************
*** 108,111 ****
--- 108,119 ----
      }
      if (!empty($category_name)) {
+         if (stristr($category_name,'/')) {
+             $category_name = explode('/',$category_name);
+             if ($category_name[count($category_name)-1]) {
+                 $category_name = $category_name[count($category_name)-1]; // no trailing slash
+             } else {
+                 $category_name = $category_name[count($category_name)-2]; // there was a trailling slash
+             }
+         }
          $title = $wpdb->get_var("SELECT cat_name FROM $wpdb->categories WHERE category_nicename = '$category_name'");
      }




More information about the cvs mailing list