WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/04/2007 12:40:00 AM (12 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 =
Note: See TracChangeset for help on using the changeset viewer.