WordPress.org

Make WordPress Core

Ticket #9393: 9393-get_author_name.diff

File 9393-get_author_name.diff, 3.5 KB (added by sivel, 9 years ago)

This patch replaces post_template.patch. Replaces get_author_name in all locations in which it is used

  • wp-includes/post-template.php

     
    12411241 * @uses wp_get_post_revisions()
    12421242 * @uses wp_post_revision_title()
    12431243 * @uses get_edit_post_link()
    1244  * @uses get_author_name()
     1244 * @uses get_the_author_meta()
    12451245 *
    12461246 * @todo split into two functions (list, form-table) ?
    12471247 *
     
    12861286                        continue;
    12871287
    12881288                $date = wp_post_revision_title( $revision );
    1289                 $name = get_author_name( $revision->post_author );
     1289                $name = get_the_author_meta( 'display_name', $revision->post_author );
    12901290
    12911291                if ( 'form-table' == $format ) {
    12921292                        if ( $left )
  • wp-includes/functions.php

     
    22852285                $trans['add']['user']          = array( __( 'Your attempt to add this user has failed.' ), false );
    22862286                $trans['delete']['users']      = array( __( 'Your attempt to delete users has failed.' ), false );
    22872287                $trans['bulk']['users']        = array( __( 'Your attempt to bulk modify users has failed.' ), false );
    2288                 $trans['update']['user']       = array( __( 'Your attempt to edit this user: “%s” has failed.' ), 'get_author_name' );
    2289                 $trans['update']['profile']    = array( __( 'Your attempt to modify the profile for: “%s” has failed.' ), 'get_author_name' );
     2288                $trans['update']['user']       = array( __( 'Your attempt to edit this user: “%s” has failed.' ), 'get_the_author_meta', 'display_name' );
     2289                $trans['update']['profile']    = array( __( 'Your attempt to modify the profile for: “%s” has failed.' ), 'get_the_author_meta', 'display_name' );
    22902290
    22912291                $trans['update']['options']    = array( __( 'Your attempt to edit your settings has failed.' ), false );
    22922292                $trans['update']['permalink']  = array( __( 'Your attempt to change your permalink structure to: %s has failed.' ), 'use_id' );
     
    22992299                if ( isset( $trans[$verb][$noun] ) ) {
    23002300                        if ( !empty( $trans[$verb][$noun][1] ) ) {
    23012301                                $lookup = $trans[$verb][$noun][1];
     2302                                if ( isset($trans[$verb][$noun][2]) )
     2303                                        $lookup_value = $trans[$verb][$noun][2];
    23022304                                $object = $matches[4];
    2303                                 if ( 'use_id' != $lookup )
    2304                                         $object = call_user_func( $lookup, $object );
     2305                                if ( 'use_id' != $lookup ) {
     2306                                        if ( isset( $lookup_value ) )
     2307                                                $object = call_user_func( $lookup, $lookup_value, $object );
     2308                                        else
     2309                                                $object = call_user_func( $lookup, $object );
     2310                                }
    23052311                                return sprintf( $trans[$verb][$noun][0], wp_specialchars($object) );
    23062312                        } else {
    23072313                                return $trans[$verb][$noun][0];
  • wp-includes/general-template.php

     
    14861486        } elseif ( is_author() ) {
    14871487                $author_id = intval( get_query_var('author') );
    14881488
    1489                 $title = esc_attr(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_author_name( $author_id ) ));
     1489                $title = esc_attr(sprintf( $args['authortitle'], get_bloginfo('name'), $args['separator'], get_the_author_meta( 'display_name', $author_id ) ));
    14901490                $href = get_author_feed_link( $author_id );
    14911491        } elseif ( is_search() ) {
    14921492                $title = esc_attr(sprintf( $args['searchtitle'], get_bloginfo('name'), $args['separator'], get_search_query() ));