mirror of
https://github.com/WenPai-org/wp-china-yes.git
synced 2025-08-03 11:11:30 +08:00
修复:AJAX下无法替换G家头像的问题
This commit is contained in:
parent
a30afa7175
commit
52835c5714
1 changed files with 16 additions and 17 deletions
|
@ -199,23 +199,6 @@ if (!class_exists('WP_CHINA_YES')) {
|
|||
|
||||
|
||||
if ( ! (defined('DOING_AJAX') && DOING_AJAX)) {
|
||||
/**
|
||||
* 替换G家头像为WP-China.org维护的大陆加速节点
|
||||
*/
|
||||
if (get_option('super_gravatar') == 1) {
|
||||
add_filter('get_avatar', function ($avatar) {
|
||||
return str_replace([
|
||||
'www.gravatar.com',
|
||||
'0.gravatar.com',
|
||||
'1.gravatar.com',
|
||||
'2.gravatar.com',
|
||||
'secure.gravatar.com',
|
||||
'cn.gravatar.com'
|
||||
], 'gravatar.wp-china-yes.net', $avatar);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 替换谷歌字体为WP-China.org维护的大陆加速节点
|
||||
*/
|
||||
|
@ -230,6 +213,22 @@ if (!class_exists('WP_CHINA_YES')) {
|
|||
$this->page_str_replace('str_replace', ['ajax.googleapis.com', 'googleajax.wp-china-yes.net'], get_option('super_googleajax'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 替换G家头像为WP-China.org维护的大陆加速节点
|
||||
*/
|
||||
if (get_option('super_gravatar') == 1) {
|
||||
add_filter('get_avatar', function ($avatar) {
|
||||
return str_replace([
|
||||
'www.gravatar.com',
|
||||
'0.gravatar.com',
|
||||
'1.gravatar.com',
|
||||
'2.gravatar.com',
|
||||
'secure.gravatar.com',
|
||||
'cn.gravatar.com'
|
||||
], 'gravatar.wp-china-yes.net', $avatar);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public function field_wpapi_cb() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue