bp_nouveau_document_activity_description( int $activity_id )
Fetch and update the document description.
Description
Parameters
- $activity_id
-
(Required) The current activity ID.
Source
File: bp-templates/bp-nouveau/includes/activity/template-tags.php
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 | function bp_nouveau_document_activity_description( $activity_id = 0 ) { if ( empty ( $activity_id ) ) { $activity_id = bp_get_activity_id(); } if ( empty ( $activity_id ) ) { return ; } $attachment_id = BP_Document::get_activity_attachment_id( $activity_id ); $document_id = BP_Document::get_activity_document_id( $activity_id ); if ( empty ( $attachment_id ) ) { return ; } $content = get_post_field( 'post_content' , $attachment_id ); echo '<div class="activity-media-description">' . '<div class="bp-media-activity-description">' . $content . '</div>' ; if ( bp_activity_user_can_edit() ) { ?> <a class = "bp-add-media-activity-description <?php echo( ! empty( $content ) ? 'show-edit' : 'show-add' ); ?>" href= "#" > <span class = "bb-icon-edit-thin" ></span> <span class = "add" ><?php _e( 'Add a description' , 'buddyboss' ); ?></span> <span class = "edit" ><?php _e( 'Edit' , 'buddyboss' ); ?></span> </a> <div class = "bp-edit-media-activity-description" style= "display: none;" > <div class = "innerWrap" > <textarea id= "add-activity-description" title= "<?php esc_html_e( 'Add a description', 'buddyboss' ); ?>" class = "textInput" name= "caption_text" placeholder= "<?php esc_html_e( 'Add a description', 'buddyboss' ); ?>" role= "textbox" ><?php echo $content ; ?></textarea> </div> <div class = "in-profile description-new-submit" > <?php ?> <input type= "hidden" id= "bp-attachment-id" value= "<?php echo $attachment_id; ?>" > <input type= "submit" id= "bp-activity-description-new-submit" class = "button small" name= "description-new-submit" value= "<?php esc_html_e( 'Done Editing', 'buddyboss' ); ?>" > <input type= "reset" id= "bp-activity-description-new-reset" class = "text-button small" value= "<?php esc_html_e( 'Cancel', 'buddyboss' ); ?>" > </div> </div> <?php } echo '</div>' ; if ( ! empty ( $document_id ) ) { $document_privacy = bp_document_user_can_manage_document( $document_id , bp_loggedin_user_id() ); $can_download_btn = ( true === (bool) $document_privacy [ 'can_download' ] ) ? true : false; if ( $can_download_btn ) { $download_url = bp_document_download_link( $attachment_id , $document_id ); if ( $download_url ) { ?> <a class = "download-document" href= "<?php echo esc_url( $download_url ); ?>" > <?php _e( 'Download' , 'buddyboss' ); ?> </a> <?php } } } } |
Changelog
Version | Description |
---|---|
BuddyBoss 1.3.5 | 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.