
內容簡介
一個更靈活的方式來附加和顯示 WordPress 使用者個人檔案的照片。
一些使用者可能沒有或不想使用全球通用頭像或 Gravatar 賬戶。他們只想使用一次指定的照片來代表他們在你的 WordPress 網站上。這個外掛可以解決這個使用情況。
透過 WordPress 媒體上傳器上傳照片或指定圖像的外部 URL,你的使用者和/或作者可以擁有一張特別針對你的網站的個人照片。*
此外掛會在使用者個人檔案頁面上新增一組自訂欄位,這些欄位可以允許使用自訂個人檔案照片。
你可以直接從使用者個人檔案頁面上加入/更改/編輯上傳的照片。外部選項可以讓你提供外部圖像的 URL 或移除它。
從 v0.4 開始,此外掛現在會篩選大多數 WordPress 主題中發現的 get_avatar() function。
只需前往使用者部分並選擇一個使用者或選擇「你的個人檔案」取決於你的權限級別。新欄位添加到使用者個人檔案頁面的底部,選擇想要使用的照片類型。上傳圖像或添加外部 URL。然後按下更新個人檔案。
如果你需要自定義方法或你的佈景主題不支援 get_avatar() hook,請使用以下範例。
要在前端檢索照片,請在你的模板頁面上使用以下範例。
<?php
// 取得文章作者的ID
$user_id = get_the_author_meta('ID');
// 設定圖像大小。接受所有註冊的圖像大小和 array(int, int)
$size = 'thumbnail';
// 使用作者ID和圖像大小參數取得圖像URL
$imgURL = get_cupp_meta($user_id, $size);
// 在網頁上列印圖像
echo '<img src="'. $imgURL .'" alt="">';
?>
你需要將上面的代碼放置在佈景主題的每個區域,你希望在其中添加和檢索你的佈景主題自定的頭像圖片。這可以包括但不限於 single.php、page.php、comments.php。
*此外掛將來的更新包括允許其他角色使用此功能,設置頁面允許自定默認圖像和其他選項。
翻譯
英語 - 預設,已經包含
荷蘭語
匈牙利語
西班牙語
鳴謝
感謝 Olaf Lederer、Harkály Gergő、sqhendr、SOMTIJDS、David Pérez
外掛標籤
開發者團隊
原文外掛簡介
A more flexible way to attach and display a photo for a WordPress user profile.
Some users might not have or want to have a gravatar account or other universal avatar account. They simply may want to use a one-time specified photo to represent them on your WordPress site. This plugin solves that use case.
With the ability to upload a photo to a user profile via the WordPress Media Uploader or by specifying an external URL to an image, your users and/or authors can have a personalized photo specific to your website.*
This plugin will add a custom set of fields to the user profile page which will allow for the use of a custom profile photo.
You can add/change/edit uploaded photos directly from the user profile page. The external option allows you to provide a URL to the external image or remove it.
As of v0.4, the plugin now filters the get_avatar() function found in most WordPress themes.
Simply go to the users section and select a user or select “Your Profile” depending on your permission level. The new fields are added to the bottom of the user profile page. Choose which type of photo you want to use. Upload an image or add an external url. Then press the Update Profile button.
If you require a customized approach or your theme does not support the get_avatar() hook, use the example below.
To retrieve the photo on the front-end use the following example on your template page(s).
';
?>
You will need to place the code above in each area of your theme where you wish to add and retrieve your theme’s custom avatar image. This can include but is not limited to single.php, page.php, and comments.php.
*Future Updates to this plugin include allowing other roles to access this feature, a settings page to allow a custom default image and other options.
Translations
English – default, always included
Dutch
Hungarian
Spanish
Credits
Thanks to Olaf Lederer, Harkály Gergő, sqhendr, SOMTIJDS, David Pérez
