WordPress.org

Make WordPress Core

Ticket #20285: 20285.diff

File 20285.diff, 933 bytes (added by scribu, 2 years ago)
  • wp-includes/author-template.php

    diff --git wp-includes/author-template.php wp-includes/author-template.php
    index c9c8dfa..fdfc34f 100644
    function get_the_author_meta($field = '', $user_id = false) { 
    102102        else 
    103103                $authordata = get_userdata( $user_id ); 
    104104 
    105         // Keys used as object vars cannot have dashes. 
    106         $field = str_replace('-', '', $field); 
    107         $field = strtolower($field); 
    108         $user_field = "user_$field"; 
    109  
    110         if ( 'id' == $field ) 
    111                 $value = isset($authordata->ID) ? (int)$authordata->ID : 0; 
    112         elseif ( isset($authordata->$user_field) ) 
    113                 $value = $authordata->$user_field; 
    114         else 
    115                 $value = isset($authordata->$field) ? $authordata->$field : ''; 
     105        $value = isset( $authordata->$field ) ? $authordata->$field : ''; 
    116106 
    117         return apply_filters('get_the_author_' . $field, $value, $user_id); 
     107        return apply_filters( 'get_the_author_' . $field, $value, $user_id ); 
    118108} 
    119109 
    120110/**