- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当用户上传新头像时,头像会发布在事件墙中。
如何使用 userId 获取此事件 ID?
我认为唯一的方法是创建一个自己的查询,对吧?
最佳答案
您可以编写查询来获取该事件。还有一个过滤器可以卡在其中,在头像上传后会被调用(稍后解释):
<?php
global $wpdb;
$query = "SELECT * FROM {$wpdb->prefix}bp_activity WHERE " .
"`type` = 'new_avatar' AND `user_id` = %d " .
"ORDER BY `date_recorded` DESC LIMIT 1";
$result =
$wpdb->get_row(
$wpdb->prepare($query, $user_id)
);
if ($result) {
// found an activity item for avatar upload
var_dump($result);
} else {
// user has not uploaded an avatar
}
stdClass Object
(
[id] => 2 <-- this is the activity ID
[user_id] => 1
[component] => profile
[type] => new_avatar
[action] => admin changed their profile picture
[content] =>
[primary_link] => http://example.com/wordpress/members/admin/
[item_id] => 0
[secondary_item_id] => 0
[date_recorded] => 2016-03-29 04:41:53
[hide_sitewide] => 0
[mptt_left] => 0
[mptt_right] => 0
[is_spam] => 0
)
xprofile_avatar_uploaded
它传递两个参数,
$item_id
(用户 ID)和
$type
(例如裁剪或相机)。此过滤器在头像上传后执行。
add_action('xprofile_avatar_uploaded', 'callback');
function callback($user_id, $type)
{
// $user_id uploaded new avatar
}
$img = bp_get_activity_avatar(['user_id' => $user_id]);
wp-content/uploads/avatars
.
$url = bp_core_fetch_avatar(['item_id' => $user_id, 'html' => false]);
关于wordpress - 从头像获取 BuddyPress 事件 id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36243484/
我正在开发一个应用程序的 Android 版本,该应用程序使用 Facebook 进行授权并检索用户的好友列表。 从 SDK v.2.0 开始,获取尚未安装您的应用程序的好友列表变得非常困难,但我成功
我正在尝试创建一个 JavaScript 头像。例如,头部元素、 body 元素等...我有一个 PHP 脚本,可以查询数据库并检索头像/用户当前佩戴的元素,它的响应位于序列化数组中。元素/头像图像位
请帮忙,快把我逼疯了,感觉应该这么简单。 我似乎无法在我尝试创建的 Card 组件中将图像/头像居中。 尝试了 alignText、alignItems、alignContent、justify。 我
我正在开发一个模块,该模块使用 GoogleAccountCredential 登录、上传文件并将文件下载到 GoogleDrive。 我想获取 google 帐户的用户名字、姓氏和头像,以便在我的登
我指的是 C# - How to get current user picture但我从来没有找到解决办法。 (我正在使用 Win7 操作系统) 对于某些用户,图片位于 C:\Users\UserNa
这里的每个新用户都会获得这些个人资料图片。它们是如何制作的?我的意思是,它们是以某种方式随机生成的吗?我可以使用类似的东西。 最佳答案 此 linux 命令将生成随机 identicon : $ cu
Game Center 是否为玩家头像提供任何支持,例如在多人游戏中? 如果不是,大概应用程序必须从本地设备检索头像? 最佳答案 我知道这是一个老问题。但对于偶然发现它的新手:请查看 GKPlayer
我已经为我正在构建的门户网站实现了 gravatar,想知道是否有 gravatar 的默认图像 URL?并非所有访问该站点的人都已登录或拥有电子邮件地址,在这种情况下,是否有可以显示的默认图像(可通
最近,有新的机器人声称能够分辨出谁看过您的个人资料照片,但大多数都是假的。 我想知道是否真的可以编写该机器人?直接通过使用 bot api 或间接地为 bot 创建 channel ... 最佳答案
最近,有新的机器人声称能够分辨出谁看过您的个人资料照片,但大多数都是假的。 我想知道是否真的可以编写该机器人?直接通过使用 bot api 或间接地为 bot 创建 channel ... 最佳答案
嘿伙计们,我正在尝试构建一个小应用程序,它可以拉入用户的个人资料图片,允许他们操作图像,然后将修改后的图像发布到他们的个人资料图片相册(理想情况下设置为他们的个人资料图片,但我不不认为这是可能的吗??
我有兴趣为聊天用户提供头像。我查看了 API(聊天、用户、内容),但找不到解决方案。用户对象没有“头像”字段 - 所以这里没有运气。内容对象(上传和浏览照片)允许用户只搜索他上传的内容(据我所知),但
我将最新的推文拉到我的主页上,但我不知道需要添加什么才能拉出头像。 有什么想法吗? getTwitters('tweet', { id: 'gezzamondo', count: 1, en
我在我的项目中使用 python-social-auth。成功建立帐户。以及如何获取 Steam 用户头像并将其保存在数据库中? 我正在尝试像这样使用管道 def get_avatar(backend
我发现这个教程 (http://www.coffeepowered.net/2009/02/15/graceful-degredation-using-gravatar-as-a-fallback-a
当 GitHub 用户注册一个帐户时,GitHub 会提供一个默认的个人资料图片,如下所示: 用户可以根据说明设置自定义头像here . 我能想到的方法是从GitHub用户下载当前的头像,然后从htt
我正在尝试从 GitHub 用户获取 GitHub 用户图片(头像)。 我找到了这些 API: https://avatars.githubusercontent.com/ https://avata
以下脚本应该返回联系人列表以及他们的电子邮件、电话号码和头像(照片)。 它就像一个魅力,我删除头像(照片)检索代码,我将它添加回来的那一刻。脚本中断。有没有人有尝试通过 phonegap 显示
在帖子后向下滚动到可以看到作者红色边框头像的位置:http://designportugal.net/transformar-leads-em-vendas/ 头像未对齐。它在正文下方。我想与它对齐。
我将 Laravel 5.2 与 Socialite 一起使用。我能够提取用户的详细信息,但问题是如果我将头像注入(inject)到它的 src 中,则头像无法正确显示。 Socialite 返回一个
我是一名优秀的程序员,十分优秀!