Make WordPress Core


Ignore:
Timestamp:
08/30/2006 06:09:12 PM (20 years ago)
Author:
ryan
Message:

Resurrect idmode. Props MichaelH and westi. fixes #2386

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r4139 r4140  
    33function get_the_author($idmode = '') {
    44        global $authordata;
    5         return apply_filters('the_author', $authordata->display_name);
     5
     6        switch ($idmode) {
     7                case 'display_name':
     8                        $id = $authordata->display_name;
     9                        break;
     10                case 'nickname':
     11                        $id = $authordata->nickname;
     12                        break;
     13                case 'login':
     14                        $id = $authordata->user_login;
     15                        break;
     16                case 'firstname':
     17                        $id = $authordata->user_firstname;
     18                        break;
     19                case 'lastname':
     20                        $id = $authordata->user_lastname;
     21                        break;
     22                case 'namefl':
     23                        $id = $authordata->user_firstname.' '.$authordata->user_lastname;
     24                        break;
     25                case 'namelf':
     26                        $id = $authordata->user_lastname.' '.$authordata->user_firstname;
     27                        break;
     28                default:
     29                        $id = $authordata->display_name;
     30        }
     31
     32        return apply_filters('the_author', $id);
    633}
    734
Note: See TracChangeset for help on using the changeset viewer.