bp_document_get_preview_image_url( $document_id, $extension, $preview_attachment_id )
Return the preview url of the file.
Description
Parameters
- $document_id
-
(Required)
- $extension
-
(Required)
- $preview_attachment_id
-
(Required)
Return
(mixed|void)
Source
File: bp-templates/bp-nouveau/includes/document/functions.php
1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 | function bp_document_get_preview_image_url( $document_id , $extension , $preview_attachment_id ) { $attachment_url = '' ; if ( in_array( $extension , bp_get_document_preview_doc_extensions(), true ) ) { $get_preview = $preview_attachment_id ; $preview_attachment_id = bp_document_get_meta( $document_id , 'preview_attachment_id' , true ); if ( ! $preview_attachment_id ) { $preview_attachment_id = $get_preview ; } $document_id = 'forbidden_' . $document_id ; $attachment_id = 'forbidden_' . $preview_attachment_id ; $output_file_src = bp_document_scaled_image_path( $preview_attachment_id ); if ( ! empty ( $preview_attachment_id ) && wp_attachment_is_image( $preview_attachment_id ) && file_exists ( $output_file_src ) ) { $attachment_url = trailingslashit( buddypress()->plugin_url ) . 'bp-templates/bp-nouveau/includes/document/preview.php?id=' . base64_encode ( $attachment_id ) . '&id1=' . base64_encode ( $document_id ); } } return apply_filters( 'bp_document_get_preview_image_url' , $attachment_url , $document_id , $extension ); } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.4.0 | Introduced. |
Questions?
We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.