Make WordPress Core

Changeset 4146


Ignore:
Timestamp:
08/31/2006 05:07:12 AM (20 years ago)
Author:
ryan
Message:

Deprecate idmode. fixes #2386

File:
1 edited

Legend:

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

    r4144 r4146  
    11<?php
    22
    3 function get_the_author($idmode = '') {
    4         global $authordata;
    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);
    33 }
    34 
    35 function the_author($idmode = '', $echo = true) {
    36         if ( $echo )
    37                 echo get_the_author($idmode);
    38         return get_the_author($idmode);
     3function get_the_author($deprecated = '') {
     4        global $authordata;
     5        return apply_filters('the_author', $authordata->display_name);
     6}
     7
     8// Using echo = false is deprecated.  Use get_the_author instead.
     9function the_author($deprecated = '', $deprecated_echo = true) {
     10        if ( $deprecated_echo )
     11                echo get_the_author();
     12        return get_the_author();
    3913}
    4014
    … …  
    163137
    164138/* the_author_posts_link() requires no get_, use get_author_posts_url() */
    165 function the_author_posts_link($idmode='') {
    166         global $authordata;
    167 
    168         echo '<a href="' . get_author_posts_url($authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars(the_author($idmode, false))) . '">' . the_author($idmode, false) . '</a>';
     139function the_author_posts_link($deprecated = '') {
     140        global $authordata;
     141
     142        echo '<a href="' . get_author_posts_url($authordata->ID, $authordata->user_nicename) . '" title="' . sprintf(__("Posts by %s"), wp_specialchars(get_the_author())) . '">' . get_the_author() . '</a>';
    169143}
    170144
Note: See TracChangeset for help on using the changeset viewer.