前言介紹
- 這款 WordPress 外掛「User Photo」是 2007-12-16 上架。
- 目前有 4000 個安裝啟用數。
- 上一次更新是 2017-11-28,距離現在已有 2714 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0.5 以上版本才可以安裝。
- 有 20 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
glen_scott | ryanhellyer | westonruter |
外掛標籤
內容簡介
這個外掛允許用戶透過「您的個人資料」頁面將個人照片與帳戶相關聯。管理員可以透過訪問「編輯使用者」頁面為用戶添加個人照片。上傳的圖像會被調整大小以符合在選項頁面上指定的維度;同時也會生成相應的縮略圖像。用戶的照片可以顯示在發佈或評論中,以幫助識別作者。新引入的模板標籤如下:
- userphoto_the_author_photo()
- userphoto_the_author_thumbnail()
- userphoto_comment_author_photo()
- userphoto_comment_author_thumbnail()
請注意:所有這些「模板標籤」必須出現在 PHP 腳本塊內(請參考以下示例)。前兩個應該在帖子循環中的the_author()附近放置,後兩個應該在評論循環中的comment_author()附近放置(或其各自相應的位置)。此外,如果設置了$authordata,就可以隨時調用userphoto_the_author_photo()和userphoto_the_author_thumbnail()(例如在側欄中)。這些模板標籤的輸出可以通過傳遞四個參數:$before、$after、$attributes和$default_src進行修改,方式如下:userphoto_the_author_photo($before, $after, $attributes, $default_src)。如果存在用戶照片(或提供了$default_src),則$before和$after參數中提供的文本將分別作為生成的img標籤的前綴和後綴(這是 WordPress 中的常見模式)。如果在$attributes參數中提供了屬性,則它們將作為生成的img元素的屬性返回。例如:userphoto_the_author_photo('', '', array(style => 'border:0'))。在0.8.1版本中新增了以下兩個模板標籤:
- userphoto($user, $before = '', $after = '', $attributes = array(), $default_src = '')
- userphoto_thumbnail($user, $before = '', $after = '', $attributes = array(), $default_src = '')
使用它們時,不需要設置全局$authordata即可顯示照片。只需傳遞$authordata、$curauth或其他包含用戶對象的變數,或(從0.9版開始)傳遞用戶ID或用戶登錄名即可。下面是一個示例,顯示如何將用戶的照片插入到發佈循環中:
//若他們沒有個人照片,這將顯示用戶的頭像。
while (have_posts()) : the_post();
原文外掛簡介
Allows a user to associate a profile photo with their account through their “Your Profile” page. Admins may
add a user profile photo by accessing the “Edit User” page. Uploaded images are resized to fit the dimensions specified
on the options page; a thumbnail image correspondingly is also generated.
User photos may be displayed within a post or a comment to
help identify the author. New template tags introduced are:
userphoto_the_author_photo()
userphoto_the_author_thumbnail()
userphoto_comment_author_photo()
userphoto_comment_author_thumbnail()
Important: all of these “template tags” must appear inside of PHP script blocks (see examples below).
The first two should be placed in the posts loop near the_author(), and the second two in the comments
loop near comment_author() (or their respective equivalents). Furthermore, userphoto_the_author_photo()
and userphoto_the_author_thumbnail() may be called anywhere (i.e. sidebar) if $authordata is set.
The output of these template tags may be modified by passing four parameters: $before, $after, $attributes, and $default_src,
as in: userphoto_the_author_photo($before, $after, $attributes, $default_src).
If the user photo exists (or $default_src is supplied), then the text provided in the $before and $after parameters is respectively
prefixed and suffixed to the generated img tag (a common pattern in WordPress). If attributes are provided in the $attributes
parameter, then they are returned as attributes of the generated img element. For example: userphoto_the_author_photo('', '', array(style => 'border:0'))
Just added in 0.8.1 release are these two new template tags:
userphoto($user, $before = '', $after = '', $attributes = array(), $default_src = '')
userphoto_thumbnail($user, $before = '', $after = '', $attributes = array(), $default_src = '')
By using these, it is uneccessary to set the global $authordata to display a photo. Just pass $authordata, $curauth or
whatever variable you have which contains the user object, or (as of version 0.9), pass in a user ID or a user login name.
Here’s an example that shows a few ways of inserting a user’s photo into the post loop:
//this will display the user’s avatar if they don’t have a user photo,
If you want to display the user’s photo in the sidebar, just get the user ID or object and pass it into userphoto() or userphoto_thumbnail() like this:
post_author); ?>
If you want to display a user’s photo their author page, you may do this:
get_queried_object()) ?>
In version 0.9 the boolean function userphoto_exists($user) has been introduced which returns true if the user has a photo and false if they do not.
Argument $user may be user object, ID, or login name. This function can be used along with avatars:
ID, 96);
?>
Or if the new “Serve Avatar as Fallback” option is turned on, then the avatar will be served by any of the regular calls to display the user photo:
Additionally, all of the regular function calls to display the user photo may be done away with alltogether if the new “Override Avatar with User Photo”
option is enabled:
user_email);
?>
Both options “Serve Avatar as Fallback” and “Override Avatar with User Photo” require that the ‘Avatar Display’ setting under Discussion be set to “Show”.
Uploaded images may be moderated by administrators via the “Edit User” page.
Localizations included for Spanish, German, Dutch, Polish, Russian, French, Hungarian, Brazilian Portuguese, Italian, and Catalan.
If you value this plugin, please donate to ensure that it may continue to be maintained and improved.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「User Photo」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.7 | 0.9.4 | 0.9.5 | 0.9.6 | 0.9.7 | 0.9.8 | 0.9.9 | trunk | 0.9.10 | 0.9.5.1 | 0.9.5.2 |
延伸相關外掛(你可能也想知道)
User Switching 》這個外掛可讓您輕鬆在 WordPress 中點擊按鈕即可快速切換使用者帳戶。您會立即登出並切換成所需使用者。這對於測試環境、協助 WooCommerce 網站上的客戶或任...。
Simple Local Avatars 》若目前使用者擁有媒體權限,此外掛會在使用者資料中增加頭像上傳欄位,並像Gravatar一樣在使用時產生所需的大小。簡單輕量化的工具。, 只需編輯使用者資料,...。
User Profile Picture 》使用 WordPress 標準媒體上傳工具,為用戶設置或刪除自定義個人資料圖像。, 查看文件和範例, , 使用者必須擁有上傳圖像的功能(通常是作者角色或更高)。您可...。
Co-Authors Plus 》透過搜尋即時輸入框,將多個作者分配給文章、頁面和自訂文章類型。共同編寫的文章將顯示在共同作者的存檔頁面和其餐單中。共同作者可以編輯他們所關聯的文章...。
New User Approve 》「New User Approve 外掛」可以自動化您的 WordPress 網站上的使用者註冊流程。, 通常在 WordPress 網站上,使用者註冊流程非常簡單。當新使用者註冊後,他們...。
Import Users from CSV 》這個外掛允許您從上傳的 CSV 檔案中匯入使用者,會新增使用者的基本資訊、元資料欄位和使用者角色。, 您還可以選擇通知新使用者並在使用者登錄時顯示密碼提示...。
Basic User Avatars 》在前端頁面和編輯個人資料畫面上添加頭像上傳欄位,讓使用者可以上傳自定義個人頭像。, WordPress 社群和會員網站使用此外掛作為輕量級解決方案提供自定義的...。
WP Post Author – Boost Your Blog's Engagement with Author Box, Social Links, Co-Authors, Guest Authors, Post Rating System, and Custom User Registration Form Builder 》age/post using the plugin. Users can log in to your website using this block., Widgets, The WP Post Author plugin comes with two widgets, Author Bo...。
Password Strength Settings for WooCommerce 》透過強制使用更強的密碼和更嚴格的強度要求,幫助保護您的 WooCommerce 網站。, 這個外掛程式有什麼功能?, WooCommerce 內置了一個密碼強度計,強制使用者使...。
Starbox – the Author Box for Humans 》is plugin., , With Starbox, you'll have a beautiful Author Box that will help your readers connect with the humans behind your content. Plus, you'l...。
Posts 2 Posts 》此外掛允許您在任何類型的文章、頁面或自訂文章之間建立多對多的關係。以下是一些使用範例:, , 手動編輯有關聯的文章清單, 文章系列, 產品與零售商之間的關...。
View Admin As 》最終的使用者切換器和角色管理員, 此外掛程式將在管理列中新增一個選單項目,您可以透過它在 WordPress 後台中切換視角。, 無需登入其他使用者帳號,您便可以...。
Recently Registered 》此外掛會為使用者列表新增一個可排序的欄位,顯示他們註冊的日期和時間。, 主要適用於單站台(因為單站台中完全沒有這方面的顯示)。在多站台網路中,它會為...。
Export User Data 》一個可以匯出 WordPress 使用者資料和元數據的外掛。, 包括匯出使用者身分、註冊日期範圍、使用者元選項和兩種匯出格式的選項。, 此外掛程式設計用來匯出儲存...。
Simple Membership Custom Messages 》這個外掛可以讓你客製化會員外掛輸出的內容保護訊息。, 你可以為不同種類的保護訊息指定自訂的訊息內容。, 這個外掛需要安裝 Simple Membership Plugin。, 安...。