From 38a0c65a59a5c6b31d9f6878236c771f7ecf8e9f Mon Sep 17 00:00:00 2001 From: rboren Date: Tue, 25 Jan 2005 05:01:54 +0000 Subject: [PATCH] If a category has parents, include those parents when generating the post permalink (if the permalink contains %category%). git-svn-id: http://svn.automattic.com/wordpress/trunk@2148 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/template-functions-links.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/wp-includes/template-functions-links.php b/wp-includes/template-functions-links.php index ba58a4c90..c3a9c4602 100644 --- a/wp-includes/template-functions-links.php +++ b/wp-includes/template-functions-links.php @@ -56,6 +56,8 @@ function get_permalink($id = false) { $cats = get_the_category($idpost->ID); $category = $cats[0]->category_nicename; + if ($parent=$cats[0]->category_parent) $category = get_category_parents($parent, FALSE, '/', TRUE) . $category; + $authordata = get_userdata($idpost->post_author); $author = $authordata->user_nicename; $rewritereplace =