bp_nouveau_get_thread_messages (intthread_id美元数组美元的帖子

每个线程的消息。

描述

参数

美元的帖子

数组(必需)$ _POST数据。

thread_id美元

int(必需)线程id。

文件:bp-templates / bp-nouveau包括/信息/ ajax.php

功能bp_nouveau_get_thread_messages($ thread_id,$ post){global $ thread_template,$ media_template,$ wpdb,$ document_template;if(!$ thread_id){return;$ bp = buddypress();$ reset_action = $ bp-> current_action;//覆盖bp_current_action()。$ bp-> current_action ='查看';bp_get_thread(array('thread_id'=> $ thread_id)));$ thread = new stdclass();//如果连接或不检查收件人。if(bp_force_friendship_to_message()&& bp_is_active('firds')){$收件人=(array)$ thread_template-> thread->收件人; // Strip the sender from the recipient list, and unset them if they are // not alone. If they are alone, let them talk to themselves. if ( isset( $recipients[ bp_loggedin_user_id() ] ) && ( count( $recipients ) > 1 ) ) { unset( $recipients[ bp_loggedin_user_id() ] ); } foreach ( $recipients as $recipient ) { if ( bp_loggedin_user_id() != $recipient->user_id && ! friends_check_friendship( bp_loggedin_user_id(), $recipient->user_id ) ) { if ( sizeof( $recipients ) > 1 ) { $thread->feedback_error = array( 'feedback' => __( 'You need to be connected with all recipients to continue this conversation.', 'buddyboss' ), 'type' => 'error', ); } else { $thread->feedback_error = array( 'feedback' => __( 'You need to be connected with this member to continue this conversation.', 'buddyboss' ), 'type' => 'error', ); } break; } } } $last_message_id = $thread_template->thread->messages[0]->id; $group_id = bp_messages_get_meta( $last_message_id, 'group_id', true ); $group_name = ''; $group_avatar = ''; $group_link = ''; $group_message_users = ''; $group_message_type = ''; $group_message_thread_type = ''; $group_message_fresh = ''; $message_from = ''; $is_deleted_group = 0; if ( ! empty( $group_id ) ) { $group_message_users = bp_messages_get_meta( $last_message_id, 'group_message_users', true ); $group_message_type = bp_messages_get_meta( $last_message_id, 'group_message_type', true ); $group_message_thread_type = bp_messages_get_meta( $last_message_id, 'group_message_thread_type', true ); $group_message_fresh = bp_messages_get_meta( $last_message_id, 'group_message_fresh', true ); $message_from = bp_messages_get_meta( $last_message_id, 'message_from', true ); if ( bp_is_active( 'groups' ) ) { $group_name = bp_get_group_name( groups_get_group( $group_id ) ); if ( empty( $group_name ) ) { $group_link = 'javascript:void(0);'; } else { $group_link = bp_get_group_permalink( groups_get_group( $group_id ) ); } $group_avatar = bp_core_fetch_avatar( array( 'item_id' => $group_id, 'object' => 'group', 'type' => 'full', 'avatar_dir' => 'group-avatars', 'alt' => sprintf( __( 'Group logo of %s', 'buddyboss' ), $group_name ), 'title' => $group_name, 'html' => false, ) ); } else { $prefix = apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix ); $groups_table = $prefix . 'bp_groups'; $group_name = $wpdb->get_var( "SELECT `name` FROM `{$groups_table}` WHERE `id` = '{$group_id}';" ); // db call ok; no-cache ok; $group_link = 'javascript:void(0);'; $group_avatar = buddypress()->plugin_url . 'bp-core/images/mystery-group.png'; $legacy_group_avatar_name = '-groupavatar-full'; $legacy_user_avatar_name = '-avatar2'; if ( ! empty( $group_name ) ) { $group_link = 'javascript:void(0);'; $directory = 'group-avatars'; $avatar_size = '-bpfull'; $avatar_folder_dir = bp_core_avatar_upload_path() . '/' . $directory . '/' . $group_id; $avatar_folder_url = bp_core_avatar_url() . '/' . $directory . '/' . $group_id; $avatar = bp_core_get_group_avatar( $legacy_user_avatar_name, $legacy_group_avatar_name, $avatar_size, $avatar_folder_dir, $avatar_folder_url ); if ( '' !== $avatar ) { $group_avatar = $avatar; } } } $is_deleted_group = ( empty( $group_name ) ) ? 1 : 0; $group_name = ( empty( $group_name ) ) ? __( 'Deleted Group', 'buddyboss' ) : $group_name; } // Simulate the loop. $args = array( 'thread_id' => $thread_id, 'per_page' => isset( $post['per_page'] ) && $post['per_page'] ? $post['per_page'] : 10, 'before' => isset( $post['before'] ) && $post['before'] ? $post['before'] : null, ); if ( ! bp_thread_has_messages( $args ) ) { // Remove the bp_current_action() override. $bp->current_action = $reset_action; wp_send_json_error( $args['before'] ? $response_no_more : $response ); } if ( ! $group_id ) { $first_message = BP_Messages_Thread::get_first_message( bp_get_the_thread_id() ); $group_message_thread_id = bp_messages_get_meta( $first_message->id, 'group_message_thread_id', true ); // group $group_id = (int) bp_messages_get_meta( $first_message->id, 'group_id', true ); if ( $group_id ) { if ( bp_is_active( 'groups' ) ) { $group_name = bp_get_group_name( groups_get_group( $group_id ) ); $group_link = bp_get_group_permalink( groups_get_group( $group_id ) ); $group_avatar = bp_core_fetch_avatar( array( 'item_id' => $group_id, 'object' => 'group', 'type' => 'full', 'avatar_dir' => 'group-avatars', 'alt' => sprintf( __( 'Group logo of %s', 'buddyboss' ), $group_name ), 'title' => $group_name, 'html' => false, ) ); } else { $prefix = apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix ); $groups_table = $prefix . 'bp_groups'; $group_name = $wpdb->get_var( "SELECT `name` FROM `{$groups_table}` WHERE `id` = '{$group_id}';" ); // db call ok; no-cache ok; $group_link = 'javascript:void(0);'; $group_avatar = buddypress()->plugin_url . 'bp-core/images/mystery-group.png'; $legacy_group_avatar_name = '-groupavatar-full'; $legacy_user_avatar_name = '-avatar2'; if ( ! empty( $group_name ) ) { $group_link = 'javascript:void(0);'; $directory = 'group-avatars'; $avatar_size = '-bpfull'; $avatar_folder_dir = bp_core_avatar_upload_path() . '/' . $directory . '/' . $group_id; $avatar_folder_url = bp_core_avatar_url() . '/' . $directory . '/' . $group_id; $avatar = bp_core_get_group_avatar( $legacy_user_avatar_name, $legacy_group_avatar_name, $avatar_size, $avatar_folder_dir, $avatar_folder_url ); if ( '' !== $avatar ) { $group_avatar = $avatar; } } } $group_name = ( empty( $group_name ) ) ? __( 'Deleted Group', 'buddyboss' ) : $group_name; } } $is_group_thread = 0; if ( (int) $group_id > 0 ) { $first_message = BP_Messages_Thread::get_first_message( bp_get_the_thread_id() ); $group_message_thread_id = bp_messages_get_meta( $first_message->id, 'group_message_thread_id', true ); // group $group_id = (int) bp_messages_get_meta( $first_message->id, 'group_id', true ); $message_users = bp_messages_get_meta( $first_message->id, 'group_message_users', true ); // all - individual $message_type = bp_messages_get_meta( $first_message->id, 'group_message_type', true ); // open - private $message_from = bp_messages_get_meta( $first_message->id, 'message_from', true ); // group if ( 'group' === $message_from && bp_get_the_thread_id() === (int) $group_message_thread_id && 'open' === $message_type ) { $is_group_thread = 1; unset($thread->feedback_error); } } $subject_deleted_text = apply_filters( 'delete_user_message_subject_text', 'Deleted' ); $is_participated = $wpdb->get_col( $wpdb->prepare( "SELECT id FROM {$bp->messages->table_name_messages} WHERE thread_id = %d AND sender_id = %d AND subject != %s", $thread_template->thread->thread_id, bp_loggedin_user_id(), $subject_deleted_text ) ); // WPCS: db call ok. // WPCS: cache ok. $thread->thread = array( 'id' => bp_get_the_thread_id(), 'subject' => wp_strip_all_tags( bp_get_the_thread_subject() ), 'started_date' => bp_nouveau_get_message_date( $thread_template->thread->first_message_date, get_option( 'date_format' ) ), 'group_id' => $group_id, 'group_name' => html_entity_decode( ucwords( $group_name ) ), 'is_group_thread' => $is_group_thread, 'is_deleted' => $is_deleted_group, 'group_avatar' => $group_avatar, 'group_link' => $group_link, 'group_message_users' => $group_message_users, 'group_message_type' => $group_message_type, 'group_message_thread_type' => $group_message_thread_type, 'group_message_fresh' => $group_message_fresh, 'message_from' => $message_from, 'is_participated' => empty( $is_participated ) ? 0 : 1, ); if ( is_array( $thread_template->thread->recipients ) ) { foreach ( $thread_template->thread->recipients as $recipient ) { if ( empty( $recipient->is_deleted ) ) { $thread->thread['recipients'][] = array( 'avatar' => esc_url( bp_core_fetch_avatar( array( 'item_id' => $recipient->user_id, 'object' => 'user', 'type' => 'thumb', 'width' => BP_AVATAR_THUMB_WIDTH, 'height' => BP_AVATAR_THUMB_HEIGHT, 'html' => false, ) ) ), 'user_link' => bp_core_get_userlink( $recipient->user_id, false, true ), 'user_name' => bp_core_get_user_displayname( $recipient->user_id ), 'is_deleted' => empty( get_userdata( $recipient->user_id ) ) ? 1 : 0, 'is_you' => $recipient->user_id === bp_loggedin_user_id(), ); } } } $thread->messages = array(); $i = 0; while ( bp_thread_messages() ) : bp_thread_the_message(); $group_id = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_id', true ); $group_message_users = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_users', true ); $group_message_type = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_type', true ); $group_message_thread_type = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_thread_type', true ); $group_message_fresh = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_fresh', true ); $message_from = bp_messages_get_meta( bp_get_the_thread_message_id(), 'message_from', true ); $message_left = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_left', true ); $message_joined = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_joined', true ); $message_banned = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_ban', true ); $message_unbanned = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_un_ban', true ); $message_deleted = bp_messages_get_meta( bp_get_the_thread_message_id(), 'bp_messages_deleted', true ); if ( $group_id && $message_from && 'group' === $message_from ) { if ( bp_is_active( 'groups' ) ) { $group_name = bp_get_group_name( groups_get_group( $group_id ) ); if ( empty( $group_name ) ) { $group_link = 'javascript:void(0);'; } else { $group_link = bp_get_group_permalink( groups_get_group( $group_id ) ); } $group_avatar = bp_core_fetch_avatar( array( 'item_id' => $group_id, 'object' => 'group', 'type' => 'full', 'avatar_dir' => 'group-avatars', 'alt' => sprintf( __( 'Group logo of %s', 'buddyboss' ), $group_name ), 'title' => $group_name, 'html' => false, ) ); } else { $prefix = apply_filters( 'bp_core_get_table_prefix', $wpdb->base_prefix ); $groups_table = $prefix . 'bp_groups'; $group_name = $wpdb->get_var( "SELECT `name` FROM `{$groups_table}` WHERE `id` = '{$group_id}';" ); // db call ok; no-cache ok; $group_link = 'javascript:void(0);'; $group_avatar = buddypress()->plugin_url . 'bp-core/images/mystery-group.png'; $legacy_group_avatar_name = '-groupavatar-full'; $legacy_user_avatar_name = '-avatar2'; if ( ! empty( $group_name ) ) { $group_link = 'javascript:void(0);'; $directory = 'group-avatars'; $avatar_size = '-bpfull'; $avatar_folder_dir = bp_core_avatar_upload_path() . '/' . $directory . '/' . $group_id; $avatar_folder_url = bp_core_avatar_url() . '/' . $directory . '/' . $group_id; $avatar = bp_core_get_group_avatar( $legacy_user_avatar_name, $legacy_group_avatar_name, $avatar_size, $avatar_folder_dir, $avatar_folder_url ); if ( '' !== $avatar ) { $group_avatar = $avatar; } } } if ( empty( $group_name ) ) { $group_name = '"' . __( 'Deleted Group', 'buddyboss' ) . '"'; if ( $group_message_users && $group_message_type && 'all' === $group_message_users && 'open' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %s to all group members.', 'buddyboss' ), $group_name ); } elseif ( $group_message_users && $group_message_type && 'individual' === $group_message_users && 'open' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %s to the people in this conversation.', 'buddyboss' ), $group_name ); } elseif ( $group_message_users && $group_message_type && 'all' === $group_message_users && 'private' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %s individually to all group members.', 'buddyboss' ), $group_name ); } elseif ( $group_message_users && $group_message_type && 'individual' === $group_message_users && 'private' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %s to individual members.', 'buddyboss' ), $group_name ); } } else { if ( $group_message_users && $group_message_type && 'all' === $group_message_users && 'open' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %2$s to all group members.', 'buddyboss' ), $group_link, $group_name ); } elseif ( $group_message_users && $group_message_type && 'individual' === $group_message_users && 'open' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %2$s to the people in this conversation.', 'buddyboss' ), $group_link, $group_name ); } elseif ( $group_message_users && $group_message_type && 'all' === $group_message_users && 'private' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %2$s individually to all group members.', 'buddyboss' ), $group_link, $group_name ); } elseif ( $group_message_users && $group_message_type && 'individual' === $group_message_users && 'private' === $group_message_type ) { $group_text = sprintf( __( 'Sent from group %2$s to individual members.', 'buddyboss' ), $group_link, $group_name ); } } $content = ''; if ( $message_left && 'yes' === $message_left ) { $content = sprintf( __( '

Left "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( $message_deleted && 'yes' === $message_deleted ) { $content = '

' . __( 'This message was deleted.', 'buddyboss' ) . '

'; } elseif ( $message_unbanned && 'yes' === $message_unbanned ) { $content = sprintf( __( '

Removed Ban "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( $message_banned && 'yes' === $message_banned ) { $content = sprintf( __( '

Ban "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( $message_joined && 'yes' === $message_joined ) { $content = sprintf( __( '

Joined "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( 'This message was deleted.' === wp_strip_all_tags( bp_get_the_thread_message_content() ) ) { $content = '

' . wp_strip_all_tags( bp_get_the_thread_message_content() ) . '

'; } else { $content = do_shortcode( bp_get_the_thread_message_content() ); } $thread->messages[ $i ] = array( 'group_name' => $group_name, 'is_deleted' => $is_deleted_group, 'group_link' => $group_link, 'group_avatar' => $group_avatar, 'group_message_users' => $group_message_users, 'group_message_type' => $group_message_type, 'group_message_thread_type' => $group_message_thread_type, 'group_message_fresh' => $group_message_fresh, 'message_from' => $message_from, 'group_text' => $group_text, 'id' => bp_get_the_thread_message_id(), 'content' => $content, 'sender_id' => bp_get_the_thread_message_sender_id(), 'sender_name' => esc_html( bp_get_the_thread_message_sender_name() ), 'sender_link' => bp_get_the_thread_message_sender_link(), 'sender_is_you' => bp_get_the_thread_message_sender_id() === bp_loggedin_user_id(), 'sender_avatar' => esc_url( bp_core_fetch_avatar( array( 'item_id' => bp_get_the_thread_message_sender_id(), 'object' => 'user', 'type' => 'thumb', 'width' => 32, 'height' => 32, 'html' => false, ) ) ), 'date' => bp_get_the_thread_message_date_sent() * 1000, 'display_date' => bp_get_the_thread_message_time_since(), ); } else { $message_left = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_left', true ); $message_joined = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_joined', true ); $message_banned = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_ban', true ); $message_unbanned = bp_messages_get_meta( bp_get_the_thread_message_id(), 'group_message_group_un_ban', true ); $message_deleted = bp_messages_get_meta( bp_get_the_thread_message_id(), 'bp_messages_deleted', true ); $content = ''; if ( $message_left && 'yes' === $message_left ) { $content = sprintf( __( '

Left "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( $message_deleted && 'yes' === $message_deleted ) { $content = '

' . __( 'This message was deleted.', 'buddyboss' ) . '

'; } elseif ( $message_unbanned && 'yes' === $message_unbanned ) { $content = sprintf( __( '

Removed Ban "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( $message_banned && 'yes' === $message_banned ) { $content = sprintf( __( '

Ban "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( $message_joined && 'yes' === $message_joined ) { $content = sprintf( __( '

Joined "%s"

', 'buddyboss' ), ucwords( $group_name ) ); } elseif ( 'This message was deleted.' === wp_strip_all_tags( bp_get_the_thread_message_content() ) ) { $content = '

' . wp_strip_all_tags( bp_get_the_thread_message_content() ) . '

'; } else { $content = do_shortcode( bp_get_the_thread_message_content() ); } $thread->messages[ $i ] = array( 'id' => bp_get_the_thread_message_id(), 'content' => $content, 'sender_id' => bp_get_the_thread_message_sender_id(), 'sender_name' => esc_html( bp_get_the_thread_message_sender_name() ), 'is_deleted' => empty( get_userdata( bp_get_the_thread_message_sender_id() ) ) ? 1 : 0, 'sender_link' => bp_get_the_thread_message_sender_link(), 'sender_is_you' => bp_get_the_thread_message_sender_id() === bp_loggedin_user_id(), 'sender_avatar' => esc_url( bp_core_fetch_avatar( array( 'item_id' => bp_get_the_thread_message_sender_id(), 'object' => 'user', 'type' => 'thumb', 'width' => 32, 'height' => 32, 'html' => false, ) ) ), 'date' => bp_get_the_thread_message_date_sent() * 1000, 'display_date' => bp_get_the_thread_message_time_since(), ); } if ( bp_is_active( 'messages', 'star' ) ) { $star_link = bp_get_the_message_star_action_link( array( 'message_id' => bp_get_the_thread_message_id(), 'url_only' => true, ) ); $thread->messages[ $i ]['star_link'] = $star_link; $thread->messages[ $i ]['is_starred'] = array_search( 'unstar', explode( '/', $star_link ) ); $thread->messages[ $i ]['star_nonce'] = wp_create_nonce( 'bp-messages-star-' . bp_get_the_thread_message_id() ); } if ( bp_is_active( 'media' ) && bp_is_messages_media_support_enabled() ) { $media_ids = bp_messages_get_meta( bp_get_the_thread_message_id(), 'bp_media_ids', true ); if ( ! empty( $media_ids ) && bp_has_media( array( 'include' => $media_ids, 'privacy' => array( 'message' ), 'order_by' => 'menu_order', 'sort' => 'ASC', 'user_id' => false, ) ) ) { $thread->messages[ $i ]['media'] = array(); while ( bp_media() ) { bp_the_media(); $thread->messages[ $i ]['media'][] = array( 'id' => bp_get_media_id(), 'message_id' => bp_get_the_thread_message_id(), 'thread_id' => bp_get_the_thread_id(), 'title' => bp_get_media_title(), 'attachment_id' => bp_get_media_attachment_id(), 'thumbnail' => bp_get_media_attachment_image_thumbnail(), 'full' => bp_get_media_attachment_image(), 'meta' => $media_template->media->attachment_data->meta, 'privacy' => bp_get_media_privacy(), ); } } } if ( bp_is_active( 'media' ) && bp_is_messages_document_support_enabled() ) { $document_ids = bp_messages_get_meta( bp_get_the_thread_message_id(), 'bp_document_ids', true ); if ( ! empty( $document_ids ) && bp_has_document( array( 'include' => $document_ids, 'order_by' => 'menu_order', 'sort' => 'ASC', ) ) ) { $thread->messages[ $i ]['document'] = array(); while ( bp_document() ) { bp_the_document(); $attachment_id = bp_get_document_attachment_id(); $extension = bp_document_extension( $attachment_id ); $svg_icon = bp_document_svg_icon( $extension, $attachment_id ); $svg_icon_download = bp_document_svg_icon( 'download' ); $download_url = bp_document_download_link( $attachment_id, bp_get_document_id() ); $filename = basename( get_attached_file( $attachment_id ) ); $size = bp_document_size_format( filesize( get_attached_file( $attachment_id ) ) ); $extension_description = ''; $url = wp_get_attachment_url( $attachment_id ); $extension_lists = bp_document_extensions_list(); $text_attachment_url = wp_get_attachment_url( $attachment_id ); $attachment_url = bp_document_get_preview_image_url( bp_get_document_id(), $extension, bp_get_document_preview_attachment_id() ); $mirror_text = bp_document_mirror_text( $attachment_id ); $audio_url = ''; if ( in_array( $extension, bp_get_document_preview_doc_extensions(), true ) ) { $attachment_url = wp_get_attachment_url( bp_get_document_preview_attachment_id() ); } if ( in_array( $extension, bp_get_document_preview_music_extensions(), true ) ) { $audio_url = bp_document_get_preview_audio_url( bp_get_document_id(), $extension, $attachment_id ); } if ( ! empty( $extension_lists ) ) { $extension_lists = array_column( $extension_lists, 'description', 'extension' ); $extension_name = '.' . $extension; if ( ! empty( $extension_lists ) && ! empty( $extension ) && array_key_exists( $extension_name, $extension_lists ) ) { $extension_description = '' . esc_html( $extension_lists[ $extension_name ] ) . ''; } } $output = ''; ob_start(); if ( in_array( $extension, bp_get_document_preview_music_extensions(), true ) ) { $audio_url = bp_document_get_preview_audio_url( bp_get_document_id(), $extension, $attachment_id ); ?>
%s
', sprintf( /* translators: %s: download url */ wp_kses_post( 'This file was truncated for preview. Please download to view the full file.', 'buddyboss' ), esc_url( $download_url ) ) ); } } } $output .= ob_get_clean(); $thread->messages[ $i ]['document'][] = array( 'id' => bp_get_document_id(), 'title' => bp_get_document_title(), 'attachment_id' => bp_get_document_attachment_id(), 'url' => $download_url, 'extension' => $extension, 'svg_icon' => $svg_icon, 'svg_icon_download' => $svg_icon_download, 'filename' => $filename, 'size' => $size, 'meta' => $document_template->document->attachment_data->meta, 'download_text' => __( 'Click to view', 'buddyboss' ), 'extension_description' => $extension_description, 'download' => __( 'Download', 'buddyboss' ), 'collapse' => __( 'Collapse', 'buddyboss' ), 'copy_download_link' => __( 'Copy Download Link', 'buddyboss' ), 'more_action' => __( 'More actions', 'buddyboss' ), 'preview' => $attachment_url, 'msg_preview' => $output, 'privacy' => bp_get_db_document_privacy(), 'author' => bp_get_document_user_id(), 'text_preview' => $text_attachment_url ? esc_url( $text_attachment_url ) : '', 'mp3_preview' => $audio_url ? $audio_url : '', 'document_title' => $filename ? $filename : '', 'mirror_text' => $mirror_text ? $mirror_text : '', ); } } } if ( bp_is_active( 'media' ) && bp_is_messages_gif_support_enabled() ) { $gif_data = bp_messages_get_meta( bp_get_the_thread_message_id(), '_gif_data', true ); if ( ! empty( $gif_data ) ) { $preview_url = wp_get_attachment_url( $gif_data['still'] ); $video_url = wp_get_attachment_url( $gif_data['mp4'] ); $thread->messages[ $i ]['gif'] = array( 'preview_url' => $preview_url, 'video_url' => $video_url, ); } } $extra_content = bp_nouveau_messages_catch_hook_content( array( 'beforeMeta' => 'bp_before_message_meta', 'afterMeta' => 'bp_after_message_meta', 'beforeContent' => 'bp_before_message_content', 'afterContent' => 'bp_after_message_content', ) ); if ( array_filter( $extra_content ) ) { $thread->messages[ $i ] = array_merge( $thread->messages[ $i ], $extra_content ); } $i += 1; endwhile; $thread->messages = array_filter( $thread->messages ); // Remove the bp_current_action() override. $bp->current_action = $reset_action; // pagination $thread->per_page = $thread_template->thread->messages_perpage; $thread->messages_count = $thread_template->thread->total_messages; $thread->next_messages_timestamp = $thread_template->thread->messages[ count( $thread_template->thread->messages ) - 1 ]->date_sent; return $thread; }

更新日志

更新日志
版本 描述
1.3.0 BuddyBoss版本 介绍了。

问题吗?

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