[wordpress插件] Custom User Profile Photo自定义用户个人资料照片

wordpress 插件 文章 2020-04-10 07:00 557 0 全屏看文

AI助手支持GPT4.0

评分
88
描述

A more flexible way to attach and display a photo for a WordPress user profile.

一种更灵活的方式为WordPress用户个人资料附加和显示照片。

Some users might not have or want to have a gravatar account or other universal avatar account.

某些用户可能没有或想要拥有gravatar帐户或其他通用化身帐户。

They simply may want to use a one-time specified photo to represent them on your WordPress site.

他们可能只是想使用一次性指定的照片在您的WordPress网站上代表他们。

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.*

能够通过WordPress Media Uploader或通过指定图像的外部URL将照片上传到用户个人资料,您的用户和/或作者可以拥有针对您网站的个性化照片。*

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.

外部选项可让您提供外部图像的URL或将其删除。

As of v0.4, the plugin now filters the get_avatar() function found in most WordPress themes.

自v0.4起,该插件现在可以过滤大多数WordPress主题中的get_avatar()函数。

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.

如果您需要自定义方法或主题不支持get_avatar()挂钩,请使用以下示例。

To retrieve the photo on the front-end use the following example on your template page(s).

要在前端检索照片,请在模板页面上使用以下示例。

  <?php    

// Retrieve The Post's Author ID    

//检索帖子的作者ID    

$user_id = get_the_author_meta('ID');    

$ user_id = get_the_author_meta('ID');    

// Set the image size.

//设置图片大小。

Accepts all registered images sizes and array(int, int)    

接受所有注册的图像大小和数组(int,int)    

$size = 'thumbnail';    

$ size ='缩略图';    

// Get the image URL using the author ID and image size params    

//使用作者ID和图片尺寸参数获取图片网址    

$imgURL = get_cupp_meta($user_id, $size);    

$ imgURL = get_cupp_meta($ user_id,$ size);    

// Print the image on the page    

//在页面上打印图像    

echo '';

回声'“”';

?>

?>

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.

这可以包括但不限于single.php,page.php和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

翻译

安装步骤

    1. Upload custom-user-profile-photo folder to the /wp-content/plugins/ directory
    2. custom-user-profile-photo 文件夹上传到 / wp-content / plugins / 目录

    3. Activate the plugin through the ‘Plugins’ menu in WordPress
    4. 通过WordPress中的“插件”菜单激活插件

    5. Place

    6. 放置 <?php get_cupp_meta($ user_id,$ size);

      ?> in your templates

    7. ?> 在您的模板中

下载地址
https://downloads.wordpress.org/plugin/custom-user-profile-photo.0.5.3.zip
-EOF-

AI助手支持GPT4.0