if permalink_structure doesn't have %category%, don't bother querying categories
git-svn-id: https://develop.svn.wordpress.org/trunk@2355 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
efc4b4e54d
commit
8150ffc1a3
@ -54,9 +54,12 @@ function get_permalink($id = false) {
|
||||
if ('' != $permalink) {
|
||||
$unixtime = strtotime($idpost->post_date);
|
||||
|
||||
$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;
|
||||
$category = '';
|
||||
if (strstr($permalink, '%category%')) {
|
||||
$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;
|
||||
|
Loading…
Reference in New Issue
Block a user