2011-08-24 38 views
0

我正在更新旧的主题,并获取此消息。wordpress更新弃用get_the_author功能

注意:get_the_author被称为与是<强>弃用< /强,因为没有可用的替代版本2.1 >参数。 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“>

我可以找到我的主题通话的functions.php如下:

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

这是get_the_author我能找到的唯一的参考在WordPress的法典它说全功能get_the_author折旧(以及通过的论点)所以想要更新但不知道如何。

回答

3

Just更换行:

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

本:

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

如出现在http://codex.wordpress.org/Function_Reference/get_the_author的功能不会被弃用,只有已被弃用的参数,因为现在该函数总是返回用户的显示名称,所以无需指定所需的返回值是用户的“登录”。

+0

谢谢,救了我很多时间试图弄清楚这一点! – macmiller

+0

很高兴帮助:) – leticia