[WordPress] 外掛分享: One User Avatar | User Profile Picture

WordPress 外掛 One User Avatar | User Profile Picture 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「One User Avatar | User Profile Picture」是 2021-05-24 上架。
  • 目前有 100000 個安裝啟用數。
  • 上一次更新是 2024-10-20,距離現在已有 195 天。
  • 外掛最低要求 WordPress 4.0 以上版本才可以安裝。
  • 有 41 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

onedesigns | collizo4sky | properfraction |

外掛標籤

avatar | gravatar | author-image | author-photo | user profile |

內容簡介

WordPress 目前只允許您使用透過 Gravatar 上傳的自訂頭像。One User Avatar 讓您使用媒體庫中上傳的任何照片作為頭像。這意味著您可以使用與文章相同的上傳工具和媒體庫,無需額外的資料夾或圖像編輯功能。此外,這個外掛是 WP User Avatar v2.2.16 的分支版。

One User Avatar 還讓您可以:

在 One User Avatar 設定中上傳自己的預設頭像。
如果使用者沒有 One User Avatar 的圖像,可以顯示使用者的 Gravatar 頭像或預設頭像。
停用 Gravatar 頭像並僅使用本機頭像。
使用 [avatar_upload] 短碼,在首頁或小工具中添加独立的上傳工具。此上傳工具僅對已登錄用戶可見。
在文章中使用 [avatar] 短碼。這些短碼可與任何主題一起使用,無論它是否支援頭像。
允許投稿者和訂閱者上傳自己的頭像。
為投稿者和訂閱者限制上傳文件大小和圖像尺寸。

版權

One User Avatar

版權所有 (c) 2021 One Designs https://onedesigns.com/

授權條款:GPLv2

來源:https://github.com/onedesigns/one-user-avatar

One User Avatar 基於 WP User Avatar v2.2.16

版權所有 (c) 2020-2021 ProfilePress https://profilepress.net/

版權所有 (c) 2014-2020 Flippercode https://www.flippercode.com/

版權所有 (c) 2013-2014 Bangbay Siboliban http://bangbay.com/

授權條款:GPLv2

來源:https://github.com/profilepress/wp-user-avatar

One User Avatar 遵循 GNU GPL 的條款進行分發

本程式是自由軟體:您可以重新分發和/或修改

它根據 GNU 通用公共許可證的版本 2 或

(根據您的選擇)任何更高版本的條款發布,

本程式發布的目的是期望它是有用的,

但是沒有任何保證;甚至沒有暗示的保證。

更多詳細訊息,請參閱 GNU 通用公共許可證。

進階設定
在自己的個人資料編輯頁面中添加 One User Avatar

您可以使用 [avatar_upload] 短碼在任何頁面上添加一個獨立的上傳工具。最好僅使用此上傳工具,而不包括其他個人資料欄位。

如果您正在構建帶有其他欄位的個人資料編輯頁面,One User Avatar 會自動添加到 show_user_profile 和 edit_user_profile 鉤子中。如果您希望將 One User Avatar 添加到其他鉤子中並從管理面板之外的其他鉤子中移除,您可以將以下代碼添加到主題的 functions.php 檔中:

do_action( 'edit_user_avatar', $current_user );

然後,要將 One User Avatar 添加到該鉤子並從其他鉤子中移除,則可添加此代碼:

function my_avatar_filter() {
// 從 show_user_profile 鉤子中移除
remove_action( 'show_user_profile', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) );
remove_action( 'show_user_profile', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) );

// 從 edit_user_profile 鉤子中移除
remove_action( 'edit_user_profile', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) );
remove_action( 'edit_user_profile', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) );

// 添加到 edit_user_avatar 鉤子
add_action( 'edit_user_avatar', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) );
add_action( 'edit_user_avatar', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) );
}
add_action( 'admin_init', 'my_avatar_filter' );

原文外掛簡介

WordPress currently only allows you to use custom avatars that are uploaded through Gravatar. One User Avatar enables you to use any photo uploaded into your Media Library as an avatar. This means you use the same uploader and library as your posts. No extra folders or image editing functions are necessary. This plugin is a fork of WP User Avatar v2.2.16.
One User Avatar also lets you:

Upload your own Default Avatar in your One User Avatar settings.
Show the user’s Gravatar avatar or Default Avatar if the user doesn’t have a One User Avatar image.
Disable Gravatar avatars and use only local avatars.
Use the [avatar_upload] shortcode to add a standalone uploader to a front page or widget. This uploader is only visible to logged-in users.
Use the [avatar] shortcode in your posts. These shortcodes will work with any theme, whether it has avatar support or not.
Allow Contributors and Subscribers to upload their own avatars.
Limit upload file size and image dimensions for Contributors and Subscribers.

Copyright
One User Avatar
Copyright (c) 2023 One Designs https://onedesigns.com/
License: GPLv2
Source: https://github.com/onedesigns/one-user-avatar
One User Avatar is based on WP User Avatar v2.2.16
Copyright (c) 2020-2021 ProfilePress https://profilepress.net/
Copyright (c) 2014-2020 Flippercode https://www.flippercode.com/
Copyright (c) 2013-2014 Bangbay Siboliban http://bangbay.com/
License: GPLv2
Source: https://github.com/profilepress/wp-user-avatar
One User Avatar is distributed under the terms of the GNU GPL
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Advanced Settings
Add One User Avatar to your own profile edit page
You can use the [avatar_upload] shortcode to add a standalone uploader to any page. It’s best to use this uploader by itself and without other profile fields.
If you’re building your own profile edit page with other fields, One User Avatar is automatically added to the show_user_profile and edit_user_profile hooks. If you’d rather have One User Avatar in its own section, you could add another hook:
do_action( 'edit_user_avatar', $current_user );

Then, to add One User Avatar to that hook and remove it from the other hooks outside of the administration panel, you would add this code to the functions.php file of your theme:
function my_avatar_filter() {
// Remove from show_user_profile hook
remove_action( 'show_user_profile', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) );
remove_action( 'show_user_profile', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) );

// Remove from edit_user_profile hook
remove_action( 'edit_user_profile', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) );
remove_action( 'edit_user_profile', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) );

// Add to edit_user_avatar hook
add_action( 'edit_user_avatar', array( 'wp_user_avatar', 'wpua_action_show_user_profile' ) );
add_action( 'edit_user_avatar', array( 'wp_user_avatar', 'wpua_media_upload_scripts' ) );
}

// Loads only outside of administration panel
if ( ! is_admin() ) {
add_action( 'init','my_avatar_filter' );
}

HTML Wrapper
You can change the HTML wrapper of the One User Avatar section by using the functions wpua_before_avatar and wpua_after_avatar. By default, the avatar code is structured like this:

Avatar


Original Size


Thumbnail

To strip out the div container and h3 heading, you would add the following filters to the functions.php file in your theme:
remove_action( 'wpua_before_avatar', 'wpua_do_before_avatar' );
remove_action( 'wpua_after_avatar', 'wpua_do_after_avatar' );

To add your own wrapper, you could create something like this:
function my_before_avatar() {
echo '

';
}
add_action( 'wpua_before_avatar', 'my_before_avatar' );

function my_after_avatar() {
echo '

';
}
add_action( 'wpua_after_avatar', 'my_after_avatar' );

This would output:


Original Size


Thumbnail

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「One User Avatar | User Profile Picture」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


2.3.0 | 2.3.1 | 2.3.2 | 2.3.3 | 2.3.4 | 2.3.5 | 2.3.6 | 2.3.7 | 2.3.8 | 2.3.9 | 2.4.0 | 2.5.0 | trunk |

延伸相關外掛(你可能也想知道)

  • Author Image 》WordPress 的作者圖像外掛可讓您輕鬆地在網站上添加作者圖像。, 它創建了一個小工具,您可以將其插入側邊欄或任何其他主題允許的小工具區域。, 現在,該插件...。
  • Easy Author Image 》Easy Author Image 可以方便地為您的個人資料頁面添加作者圖像,只需安裝此 WordPress 外掛,您的「個人資料」選項卡(位於「使用者」下方)將多了一個名為「...。
  • User Avatar – Reloaded 》WordPress 目前只允許透過 Gravatar 上傳自訂頭像。 WP User Avatar 可讓您使用任何上傳到您的媒體庫中的照片作為頭像,這意味著您可以使用相同的上傳工具和...。
  • Author or User Image 》WordPress作者/使用者圖像讓您設定作者圖像。, 使用此外掛,您可以設定作者的圖像。, 具有刪除使用者圖像或阻止特定使用者的功能(新增)。, 此照片將顯示在...。
  • Profile Xtra 》這個 WordPress 外掛提供了一個讓作者可以在其個人資料頁面上添加一張圖片的功能,並可以在其文章中使用這張圖片作為頭像。此外,作者還可以添加不同的社交網...。

文章
Filter
Mastodon