bp_blogs_publish_post_actity_meta($ activity_id.WP_POST.$帖子大批$ args.的)

记录关于发布博客文章的活动元数据。

描述

参数

$ activity_id.

的)(必需的)活动项的ID。

$帖子

WP_POST.的)(必需的)帖子对象。

$ args.

大批的)(必需的)争论数组。

来源

文件:BP-BLOGS / BP-BLOGS-FUNCTION.php

函数bp_blogs_publish_post_actity_meta($ activity_id,$ post,$ args){if(空($ activity_id)||!in_array($ post-> post_type,bp_core_get_active_custom_post_type_feed())){return;} bp_actity_update_meta($ activity_id,'post_title',$ post-> post_title);if(!空($ args ['post_url']))){$ post_permalink = $ args ['post_url'];} else {$ post_permalink = $ post-> guid;} bp_actity_update_meta($ activity_id,'post_url',$ post_permalink);$ args =数组('name'=> $ post-> post_type);$输出='对象';//名称或对象$ cu_post_types = get_post_types($ args,$ output);foreach($ cu_post_types,$ cu){$ singular_label_name = strtolower($ cu->标签 - > singular_name);$ admin_filters ='new'。$ singular_label_name。' published'; bp_activity_update_meta( $activity_id, 'admin_filters', $admin_filters ); // Update the blog's last activity. bp_blogs_update_blogmeta( $args['item_id'], 'last_activity', bp_core_current_time() ); /** * Fires after BuddyPress has recorded metadata about a published blog post. * * @since BuddyPress 1.0.0 * * @param int $ID ID of the blog post being recorded. * @param WP_Post $post WP_Post object for the current blog post. * @param string $value ID of the user associated with the current blog post. */ do_action( 'bp_blogs_new_blog_post', $post->ID, $post, $args['user_id'] ); }

变更乐

变更乐
版本 描述
BuddyPress 2.2.0. 介绍。

问题?

我们总是很乐意帮助您可能拥有的代码或其他问题!搜索我们开发人员文档联系支持,或与我们联系销售团队