Skip to content

Commit

Permalink
Gravatar source
Browse files Browse the repository at this point in the history
  • Loading branch information
owen0o0 committed Jul 30, 2024
1 parent df13491 commit 4217029
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 4 additions & 6 deletions inc/frame/config/framework.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Author URI: https://www.iowen.cn/
* @Date: 2019-02-22 21:26:02
* @LastEditors: iowen
* @LastEditTime: 2024-07-30 18:22:23
* @LastEditTime: 2024-07-30 23:21:25
* @FilePath: /WebStack/inc/frame/config/framework.config.php
* @Description:
*/
Expand Down Expand Up @@ -466,14 +466,12 @@
'id' => 'gravatar',
'type' => 'select',
'title' => 'Gravatar加速',
'default' => 'geekzu',
'default' => 'chinayes',
'options' => array(
'gravatar' => __('使用 Gravatar官方 默认服务器','io_setting'),
'cravatar' => __('使用 Cravatar 镜像加速服务','io_setting'),
'sep' => __('使用 sep.cc 镜像加速服务','io_setting'),
'loli' => __('使用 loli 镜像加速服务','io_setting'),
'chinayes' => __('使用 wp-china-yes.cn 镜像加速服务','io_setting'),
'geekzu' => __('使用 极客族 提供的加速服务','io_setting'),
'iocdn' => '一为云 加速服务(cdn.iocdn.cc)',
'chinayes' => __('使用 wp-china-yes.cn 镜像加速服务','io_setting')
),
),

Expand Down
13 changes: 8 additions & 5 deletions inc/inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Author URI: https://www.iowen.cn/
* @Date: 2019-02-22 21:26:02
* @LastEditors: iowen
* @LastEditTime: 2024-07-30 22:06:04
* @LastEditTime: 2024-07-30 23:22:56
* @FilePath: /WebStack/inc/inc.php
* @Description:
*/
Expand Down Expand Up @@ -521,7 +521,7 @@ function walker_nav_menu_start_el( $item_output, $item, $depth, $args ){


add_filter('pre_get_avatar_data', function($args, $id_or_email){
$gravatar_cdn = io_get_option('gravatar','geekzu');
$gravatar_cdn = io_get_option('gravatar','chinayes');
if($gravatar_cdn=='gravatar'){
return $args;
}
Expand Down Expand Up @@ -584,11 +584,14 @@ function walker_nav_menu_start_el( $item_output, $item, $depth, $args ){
case "chinayes":
$url = '//gravatar.wp-china-yes.net/avatar/'.$email_hash;
break;
case "geekzu":
$url = '//sdn.geekzu.org/avatar/'.$email_hash;
case "iocdn":
$url = '//cdn.iocdn.cc/avatar/'.$email_hash;
break;
case "qiniu":
$url = '//dn-qiniu-avatar.qbox.me/avatar/'.$email_hash;
break;
default:
$url = '//sdn.geekzu.org/avatar/'.$email_hash;
$url = '//gravatar.wp-china-yes.net/avatar/'.$email_hash;
}

$url_args = array_filter([
Expand Down

0 comments on commit 4217029

Please sign in to comment.