bp_nouveau_ajax_groups_get_group_members_listing ()
检索用于发送组消息的可能成员列表。
描述
源
文件:bp-templates / bp-nouveau包括/团体/ ajax.php
Function bp_nouveau_ajax_groups_get_group_members_listing() {if (false === bp_disable_group_messages()) {return;}如果(空($ _POST['行动'])){wp_send_json_error ();} $response = array('feedback' => '', 'type' => 'error',);If (false === bp_is_active('messages')) {wp_send_json_error($response);}如果(空(wp_unslash ($ _POST['现时标志 '] ) ) || !wp_verify_nonce(wp_unslash($_POST['nonce']), 'retrieve_group_members')) {wp_send_json_error($response); } $per_page = apply_filters( 'bp_nouveau_ajax_groups_get_group_members_listing_per_page', 10 ); $search_per_page = apply_filters( 'bp_nouveau_ajax_groups_get_group_members_listing_search_per_page', 99999999999999 ); $page = (int) $_POST['page']; if ( isset( $_POST['term'] ) && '' !== $_POST['term'] ) { $args = array( 'per_page' => $search_per_page, 'group_id' => $_POST['group'], 'search_terms' => $_POST['term'], 'exclude' => array( bp_loggedin_user_id() ), 'exclude_admins_mods' => false, ); } else { $args = array( 'page' => $page, 'per_page' => $per_page, 'group_id' => $_POST['group'], 'exclude' => array( bp_loggedin_user_id() ), 'exclude_admins_mods' => false, ); } $group_members = groups_get_group_members( $args ); $html = ''; $paginate = ''; $result = array(); $total_page = 0; if ( empty( $group_members['members'] ) ) { wp_send_json_success( array( 'results' => 'no_member' ) ); } else { $total_page = (int) ceil( (int) $group_members['count'] / $per_page ); ob_start(); foreach ( $group_members['members'] as $member ) { $image = htmlspecialchars_decode( bp_core_fetch_avatar( array( 'item_id' => $member->ID, 'object' => 'user', 'type' => 'thumb', 'class' => '', ) ) ); $name = bp_core_get_user_displayname( $member->ID ); ?>'。__('加载收件人时出现问题。请再试一次。’、‘buddyboss’)。
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.2.9 | 介绍了。 |