bp_document_mirror_text (attachment_id美元

返回文档文件的预览文本。

描述

参数

attachment_id美元

(必需)

返回

(假| |混合字符串)

文件:bp-templates / bp-nouveau / /文档/显然也包括

函数bp_document_mirror_text($attachment_id) {$mirror_text = ";$extension = bp_document_extension($attachment_id);If (isset($extension) && !empty($extension) && in_array($extension, bp_get_document_preview_code_extensions())) {$words = 8000;更多的美元= '…';$text = get_post_meta($attachment_id, 'document_preview_mirror_text', true);If ($text) {$text = strlen($text) > $words ?Substr ($text, 0, $words)。“…”:$文本;} else {if (file_exists(get_attachment_file ($attachment_id))) {$image_data = file_get_contents(get_attachment_file ($attachment_id)); $words = 10000; $mirror_text = strlen( $image_data ) > $words ? substr( $image_data, 0, $words ) . '...' : $image_data; update_post_meta( $attachment_id, 'document_preview_mirror_text', $mirror_text ); } } } return $mirror_text; }

更新日志

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

问题吗?

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