BP_Activity_List_Table:: column_comment (数组美元的项目

内容列,以及“快速管理”滚动操作。

描述

在CSS中称为“评论”,这样我们可以重用一些WP核心CSS。

另请参阅

参数

美元的项目

数组(必需)单个项(一整行)。

文件:bp-activity /类/ class-bp-activity-list-table.php

function column_comment($item){//判断我们正在处理的item (row)的类型。If ($item['is_spam']) $item_status = 'spam';Else $item_status = '所有';//预订项:Reply | Edit | Spam |永久删除。$ =操作数组('回复 ' => '', ' 编辑 ' => '', ' 垃圾邮件 ' => '', ' unspam ' => '', ' 删除 ' => '', );//创建动作url。$base_url = bp_get_admin_url('admin.php?page=bp-activity&aid='。$ item [' id ']);$spam_nonce = esc_html('_wpnonce='。wp_create_nonce(“spam-activity_”。 $item['id'] ) ); $delete_url = $base_url . "&action=delete&$spam_nonce"; $edit_url = $base_url . '&action=edit'; $ham_url = $base_url . "&action=ham&$spam_nonce"; $spam_url = $base_url . "&action=spam&$spam_nonce"; // Rollover actions. // Reply - JavaScript only; implemented by AJAX. if ( 'spam' != $item_status ) { if ( $this->can_comment( $item ) ) { $actions['reply'] = sprintf( '%s', __( 'Reply', 'buddyboss' ) ); } else { $actions['reply'] = sprintf( '%s', __( 'Replies disabled', 'buddyboss' ) ); } // Edit. $actions['edit'] = sprintf( '%s', $edit_url, __( 'Edit', 'buddyboss' ) ); } // Spam/unspam. if ( 'spam' == $item_status ) $actions['unspam'] = sprintf( '%s', $ham_url, __( 'Not Spam', 'buddyboss' ) ); else $actions['spam'] = sprintf( '%s', $spam_url, __( 'Spam', 'buddyboss' ) ); // Delete. $actions['delete'] = sprintf( '%s', $delete_url, "javascript:return confirm('" . esc_js( __( 'Are you sure?', 'buddyboss' ) ) . "'); ", __( 'Delete Permanently', 'buddyboss' ) ); // Start timestamp. echo ''; // Get activity content - if not set, use the action. if ( ! empty( $item['content'] ) ) { $activity = new BP_Activity_Activity( $item['id'] ); /** This filter is documented in bp-activity/bp-activity-template.php */ $content = apply_filters_ref_array( 'bp_get_activity_content_body', array( $item['content'], &$activity ) ); } else { /** * Filters current activity item action. * * @since BuddyPress 1.2.0 * * @var array $item Array index holding current activity item action. */ $content = apply_filters_ref_array( 'bp_get_activity_action', array( $item['action'] ) ); } /** * Filter here to add extra output to the activity content into the Administration. * * @since BuddyPress 2.4.0 * * @param string $content The activity content. * @param array $item The activity object converted into an array. */ echo apply_filters( 'bp_activity_admin_comment_content', $content, $item ) . ' ' . $this->row_actions( $actions ); }

更新日志

更新日志
版本 描述
BuddyPress 1.6.0 介绍了。

问题吗?

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