欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來到入門教程網(wǎng)!

WordPress

當(dāng)前位置:主頁 > CMS教程 > WordPress >

禁用wordpress gravatar使用本地頭像提高網(wǎng)頁打開速度

來源:本站原創(chuàng)|時間:2020-01-11|欄目:WordPress|點(diǎn)擊: 次

WordPress默認(rèn)的頭像是讀取gravatar.com上的圖片的,對于國內(nèi)用戶來說會使網(wǎng)頁打開速度變慢。所以我決定刪除掉這塊功能。

修改get_avatar函數(shù),在wp-includes/pluggable.php內(nèi)。修改后的函數(shù)如下:

復(fù)制代碼
代碼如下:

if ( !function_exists( 'get_avatar' ) ) :
/**
* Retrieve the avatar for a user who provided a user ID or email address.
*
* @since 2.5
* @param int|string|object $id_or_email A user ID, email address, or comment object
* @param int $size Size of the avatar image
* @param string $default URL to a default image to use if no avatar is available
* @param string $alt Alternate text to use in image tag. Defaults to blank
* @return string tag for the user's avatar
*/
function get_avatar( $id_or_email, $size = '96', $default = '', $alt = false ) {
if ( ! get_option('show_avatars') )
return false;
if ( false === $alt)
$safe_alt = '';
else
$safe_alt = esc_attr( $alt );
if ( !is_numeric($size) )
$size = '96';
$default = includes_url('images/blank.gif');
$avatar = "";
return apply_filters('get_avatar', $avatar, $id_or_email, $size, $default, $alt);
}
endif;

即使用該函數(shù),僅可能返回一個默認(rèn)頭像(位于wp-includes/images/blank.gif內(nèi)),再配合simple local avatars或Add Local Avatar插件,就實(shí)現(xiàn)了預(yù)期的效果。

上一篇:wordpress導(dǎo)航如何設(shè)置具體該怎么操作

欄    目:WordPress

下一篇:WordPress 防止惡意評論的方法

本文標(biāo)題:禁用wordpress gravatar使用本地頭像提高網(wǎng)頁打開速度

本文地址:http://mengdiqiu.com.cn/a1/WordPress/12803.html

網(wǎng)頁制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語言數(shù)據(jù)庫服務(wù)器

如果侵犯了您的權(quán)利,請與我們聯(lián)系,我們將在24小時內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有