Avoid unnecesary call to get_userdata in get_permalink function. Props xknown. fixes #5414
git-svn-id: https://develop.svn.wordpress.org/trunk@6352 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
364a7f55c4
commit
5398d5ac32
@ -73,7 +73,7 @@ function get_permalink($id = 0) {
|
|||||||
$unixtime = strtotime($post->post_date);
|
$unixtime = strtotime($post->post_date);
|
||||||
|
|
||||||
$category = '';
|
$category = '';
|
||||||
if (strpos($permalink, '%category%') !== false) {
|
if ( strpos($permalink, '%category%') !== false ) {
|
||||||
$cats = get_the_category($post->ID);
|
$cats = get_the_category($post->ID);
|
||||||
if ( $cats )
|
if ( $cats )
|
||||||
usort($cats, '_usort_terms_by_ID'); // order by ID
|
usort($cats, '_usort_terms_by_ID'); // order by ID
|
||||||
@ -82,8 +82,12 @@ function get_permalink($id = 0) {
|
|||||||
$category = get_category_parents($parent, FALSE, '/', TRUE) . $category;
|
$category = get_category_parents($parent, FALSE, '/', TRUE) . $category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$author = '';
|
||||||
|
if ( strpos($permalink, '%author%') !== false ) {
|
||||||
$authordata = get_userdata($post->post_author);
|
$authordata = get_userdata($post->post_author);
|
||||||
$author = $authordata->user_nicename;
|
$author = $authordata->user_nicename;
|
||||||
|
}
|
||||||
|
|
||||||
$date = explode(" ",date('Y m d H i s', $unixtime));
|
$date = explode(" ",date('Y m d H i s', $unixtime));
|
||||||
$rewritereplace =
|
$rewritereplace =
|
||||||
array(
|
array(
|
||||||
|
Loading…
Reference in New Issue
Block a user