Changeset 6352

Show
Ignore:
Timestamp:
12/04/07 00:40:00 (1 year ago)
Author:
ryan
Message:

Avoid unnecesary call to get_userdata in get_permalink function. Props xknown. fixes #5414

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/link-template.php

    r6180 r6352  
    7474 
    7575        $category = ''; 
    76         if (strpos($permalink, '%category%') !== false) { 
     76        if ( strpos($permalink, '%category%') !== false ) { 
    7777            $cats = get_the_category($post->ID); 
    7878            if ( $cats ) 
     
    8383        } 
    8484 
    85         $authordata = get_userdata($post->post_author); 
    86         $author = $authordata->user_nicename; 
     85        $author = ''; 
     86        if ( strpos($permalink, '%author%') !== false ) { 
     87            $authordata = get_userdata($post->post_author); 
     88            $author = $authordata->user_nicename; 
     89        } 
     90 
    8791        $date = explode(" ",date('Y m d H i s', $unixtime)); 
    8892        $rewritereplace =