BBP_Replies_Admin:: row_actions (数组美元的行为,数组美元的回复)
回复行操作
描述
删除回复标题下的快速编辑操作链接,并添加内容和垃圾链接
参数
- 美元的行为
-
(数组)(必需)行动
- 美元的回复
-
(数组)(必需)回复对象
返回
(数组)美元的行为动作
源
文件:bp-forums / admin / replies.php
Public function row_actions($actions, $reply) {if ($this->bail())返回$actions;Unset ($actions['inline hide-if-no-js']);//简单的hack显示回复内容bbp_reply_content($reply->ID);//回复视图链接到主题$actions['view'] = 'ID)))。“rel = "永久链接" >”。esc_html__('View', 'buddyboss')。' < / > '; // User cannot view replies in trash if ( ( bbp_get_trash_status_id() === $reply->post_status ) && !current_user_can( 'view_trash' ) ) unset( $actions['view'] ); // Only show the actions if the user is capable of viewing them if ( current_user_can( 'moderate', $reply->ID ) ) { if ( in_array( $reply->post_status, array( bbp_get_public_status_id(), bbp_get_spam_status_id() ) ) ) { $spam_uri = wp_nonce_url( add_query_arg( array( 'reply_id' => $reply->ID, 'action' => 'bbp_toggle_reply_spam' ), remove_query_arg( array( 'bbp_reply_toggle_notice', 'reply_id', 'failed', 'super' ) ) ), 'spam-reply_' . $reply->ID ); if ( bbp_is_reply_spam( $reply->ID ) ) { $actions['spam'] = '' . esc_html__( 'Not spam', 'buddyboss' ) . ''; } else { $actions['spam'] = '' . esc_html__( 'Spam', 'buddyboss' ) . ''; } } } // Trash if ( current_user_can( 'delete_reply', $reply->ID ) ) { if ( bbp_get_trash_status_id() === $reply->post_status ) { $post_type_object = get_post_type_object( bbp_get_reply_post_type() ); $actions['untrash'] = " add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), wp_nonce_url( admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $reply->ID ) ), 'untrash-' . $reply->post_type . '_' . $reply->ID ) ) ) . "'>" . esc_html__( 'Restore', 'buddyboss' ) . ""; } elseif ( EMPTY_TRASH_DAYS ) { $actions['trash'] = " add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID ) ) ) . "'>" . esc_html__( 'Trash', 'buddyboss' ) . ""; } if ( bbp_get_trash_status_id() === $reply->post_status || !EMPTY_TRASH_DAYS ) { $actions['delete'] = " add_query_arg( array( 'post_type' => bbp_get_reply_post_type() ), admin_url( 'edit.php' ) ) ), get_delete_post_link( $reply->ID, '', true ) ) ) . "'>" . esc_html__( 'Delete Permanently', 'buddyboss' ) . ""; } elseif ( bbp_get_spam_status_id() === $reply->post_status ) { unset( $actions['trash'] ); } } return $actions; }
更新日志
版本 | 描述 |
---|---|
bbPress (r2577) | 介绍了。 |