wordpress updating deprecated get_the_author function

I am updating an older theme and am getting this message.

Notice: get_the_author was called with an argument that is <strong>deprecated</strong> since version 2.1 with no alternative available. in /srv/www/virtual/example.com/htdocs/zzblog/wp-includes/functions.php on line 3468
home page pageid-641 page-author-test page-template page-template-MIMindexMOD-php”>

Read More

I can find the call in my themes functions.php as follows:

c[] = 'page-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login')));

this is the only reference to get_the_author that I can find. In the wordpress codex it says the entire function get_the_author is depreciated (along with the passed argument) so would like to update but not sure how.

Related posts

Leave a Reply

1 comment

  1. Just replace the line:

    c[] = 'page-author-' . sanitize_title_with_dashes(strtolower(get_the_author('login')));
    

    by this:

    c[] = 'page-author-' . sanitize_title_with_dashes(strtolower(get_the_author()));
    

    The function as appears in http://codex.wordpress.org/Function_Reference/get_the_author isn’t deprecated, only is deprecated the parameter, because now the function returns always the user display name, so no need to specify that the desired return value is the user ‘login’.