diff --git src/bp-activity/bp-activity-functions.php src/bp-activity/bp-activity-functions.php
index 3975cecc5..a32c77398 100644
|
|
function bp_activity_create_summary( $content, $activity ) { |
3460 | 3460 | 'width' => isset( $GLOBALS['content_width'] ) ? (int) $GLOBALS['content_width'] : 'medium', |
3461 | 3461 | ); |
3462 | 3462 | |
3463 | | $post_url = ''; |
| 3463 | $post_url = ''; |
| 3464 | $post_title = ''; |
| 3465 | $bp_excerpt_args = array( |
| 3466 | 'html' => false, |
| 3467 | 'filter_shortcodes' => true, |
| 3468 | 'strip_tags' => true, |
| 3469 | 'remove_links' => true, |
| 3470 | ); |
3464 | 3471 | // Get the WP_Post object if this activity type is a blog post. |
3465 | 3472 | if ( $activity['type'] === 'new_blog_post' ) { |
3466 | | $content = get_post( $activity['secondary_item_id'] ); |
3467 | | $post_url = $content->guid; |
| 3473 | $content = get_post( $activity['secondary_item_id'] ); |
| 3474 | $post_url = $content->guid; |
| 3475 | $post_title = sprintf( |
| 3476 | '<strong><a href="%1$s">%2$s</a></strong>', |
| 3477 | esc_url( $post_url ), |
| 3478 | esc_html( $content->post_title ) |
| 3479 | ); |
| 3480 | |
| 3481 | $more_text = sprintf( |
| 3482 | '<span>%s</span>', |
| 3483 | trim( __( ' […]', 'buddypress' ) ) |
| 3484 | ); |
| 3485 | |
| 3486 | /** This filter is documented in wp-admin/includes/post-template.php */ |
| 3487 | $bp_excerpt_args['ending'] = apply_filters( |
| 3488 | 'the_content_more_link', |
| 3489 | sprintf( |
| 3490 | ' <a href="%1$s">%2$s</a>', |
| 3491 | esc_url( $post_url ), |
| 3492 | $more_text |
| 3493 | ), |
| 3494 | $more_text |
| 3495 | ); |
3468 | 3496 | } |
3469 | 3497 | |
3470 | 3498 | /** |
… |
… |
function bp_activity_create_summary( $content, $activity ) { |
3579 | 3607 | } |
3580 | 3608 | |
3581 | 3609 | // Generate a text excerpt for this activity item (and remove any oEmbeds URLs). |
3582 | | $summary = bp_create_excerpt( html_entity_decode( $content ), 225, array( |
3583 | | 'html' => false, |
3584 | | 'filter_shortcodes' => true, |
3585 | | 'strip_tags' => true, |
3586 | | 'remove_links' => true |
3587 | | ) ); |
| 3610 | $summary_parts = array( |
| 3611 | str_replace( |
| 3612 | array( "\n", "\r" ), |
| 3613 | ' ', |
| 3614 | trim( bp_create_excerpt( html_entity_decode( $content ), 225, $bp_excerpt_args ) ) |
| 3615 | ), |
| 3616 | ); |
3588 | 3617 | |
3589 | 3618 | if ( $use_media_type === 'embeds' ) { |
3590 | | $summary .= PHP_EOL . PHP_EOL . $extracted_media['url']; |
| 3619 | $summary_parts[] = PHP_EOL . PHP_EOL . $extracted_media['url']; |
3591 | 3620 | } elseif ( $use_media_type === 'images' ) { |
3592 | 3621 | $extracted_media_url = isset( $extracted_media['url'] ) ? $extracted_media['url'] : ''; |
| 3622 | $image_tag = sprintf( '<img src="%s"> ', esc_url( $extracted_media_url ) ); |
3593 | 3623 | |
3594 | 3624 | if ( $post_url ) { |
3595 | | $summary .= sprintf( '<a href="%1$s" class="activity-post-featured-image"><img src="%2$s"></a>', esc_url( $post_url ), esc_url( $extracted_media_url ) ); |
3596 | | } else { |
3597 | | $summary .= sprintf( ' <img src="%s">', esc_url( $extracted_media_url ) ); |
| 3625 | $image_tag = sprintf( '<a href="%1$s" class="activity-post-featured-image">%2$s</a> ', esc_url( $post_url ), trim( $image_tag ) ); |
| 3626 | array_unshift( $summary_parts, $image_tag ); |
3598 | 3627 | } |
3599 | 3628 | } elseif ( in_array( $use_media_type, array( 'audio', 'videos' ), true ) ) { |
3600 | | $summary .= PHP_EOL . PHP_EOL . $extracted_media['original']; // Full shortcode. |
| 3629 | $summary_parts[] = PHP_EOL . PHP_EOL . $extracted_media['original']; // Full shortcode. |
| 3630 | } |
| 3631 | |
| 3632 | if ( $post_title ) { |
| 3633 | array_unshift( $summary_parts, $post_title ); |
3601 | 3634 | } |
3602 | 3635 | |
| 3636 | // Join summary parts. |
| 3637 | $summary = implode( '', $summary_parts ); |
| 3638 | |
3603 | 3639 | /** |
3604 | 3640 | * Filters the newly-generated summary for the activity item. |
3605 | 3641 | * |
diff --git src/bp-templates/bp-legacy/css/buddypress-rtl.css src/bp-templates/bp-legacy/css/buddypress-rtl.css
index 574c72675..2f8791372 100644
|
|
body.activity-permalink #buddypress .activity-list li .activity-header > p { |
326 | 326 | padding-right: 10px; |
327 | 327 | } |
328 | 328 | |
| 329 | #buddypress .activity-list li.new_blog_post .activity-content .activity-inner strong { |
| 330 | display: block; |
| 331 | margin-bottom: 0.8em; |
| 332 | } |
| 333 | |
| 334 | #buddypress .activity-list li.new_blog_post .activity-content .activity-inner img { |
| 335 | float: right; |
| 336 | margin-left: 0.8em; |
| 337 | } |
| 338 | |
329 | 339 | body.activity-permalink #buddypress .activity-content .activity-inner, |
330 | 340 | body.activity-permalink #buddypress .activity-content blockquote { |
331 | 341 | margin-right: 0; |
diff --git src/bp-templates/bp-legacy/css/buddypress.css src/bp-templates/bp-legacy/css/buddypress.css
index 967d76e67..5086362ee 100644
|
|
body.activity-permalink #buddypress .activity-list li .activity-header > p { |
326 | 326 | padding-left: 10px; |
327 | 327 | } |
328 | 328 | |
| 329 | #buddypress .activity-list li.new_blog_post .activity-content .activity-inner strong { |
| 330 | display: block; |
| 331 | margin-bottom: 0.8em; |
| 332 | } |
| 333 | |
| 334 | #buddypress .activity-list li.new_blog_post .activity-content .activity-inner img { |
| 335 | float: left; |
| 336 | margin-right: 0.8em; |
| 337 | } |
| 338 | |
329 | 339 | body.activity-permalink #buddypress .activity-content .activity-inner, |
330 | 340 | body.activity-permalink #buddypress .activity-content blockquote { |
331 | 341 | margin-left: 0; |
diff --git src/bp-templates/bp-nouveau/common-styles/_bp_activity_entries.scss src/bp-templates/bp-nouveau/common-styles/_bp_activity_entries.scss
index da008c351..78dc17ca0 100644
|
|
|
90 | 90 | } |
91 | 91 | } // close li forum elements |
92 | 92 | |
| 93 | &.new_blog_post { |
| 94 | |
| 95 | .activity-inner { |
| 96 | |
| 97 | strong { |
| 98 | display: block; |
| 99 | margin-bottom: 0.8em; |
| 100 | } |
| 101 | |
| 102 | img { |
| 103 | float: left; |
| 104 | margin-right: 0.8em; |
| 105 | } |
| 106 | } |
| 107 | } // close li blog post elements |
| 108 | |
93 | 109 | |
94 | 110 | &.newest_mentions_activity, |
95 | 111 | &.newest_friends_activity, |
diff --git src/bp-templates/bp-nouveau/css/buddypress-rtl.css src/bp-templates/bp-nouveau/css/buddypress-rtl.css
index ede72290c..d2d5d0753 100644
|
|
body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en |
1306 | 1306 | padding-right: 1em; |
1307 | 1307 | } |
1308 | 1308 | |
| 1309 | .activity-list .activity-item.new_blog_post .activity-inner strong { |
| 1310 | display: block; |
| 1311 | margin-bottom: 0.8em; |
| 1312 | } |
| 1313 | |
| 1314 | .activity-list .activity-item.new_blog_post .activity-inner img { |
| 1315 | float: right; |
| 1316 | margin-left: 0.8em; |
| 1317 | } |
| 1318 | |
1309 | 1319 | .activity-list .activity-item.newest_mentions_activity, .activity-list .activity-item.newest_friends_activity, .activity-list .activity-item.newest_groups_activity, .activity-list .activity-item.newest_blogs_activity { |
1310 | 1320 | background: rgba(31, 179, 221, 0.1); |
1311 | 1321 | } |
diff --git src/bp-templates/bp-nouveau/css/buddypress.css src/bp-templates/bp-nouveau/css/buddypress.css
index 871b19f0c..61fa061c9 100644
|
|
body.buddypress article.page > .entry-header:not(.alignwide):not(.alignfull) .en |
1306 | 1306 | padding-left: 1em; |
1307 | 1307 | } |
1308 | 1308 | |
| 1309 | .activity-list .activity-item.new_blog_post .activity-inner strong { |
| 1310 | display: block; |
| 1311 | margin-bottom: 0.8em; |
| 1312 | } |
| 1313 | |
| 1314 | .activity-list .activity-item.new_blog_post .activity-inner img { |
| 1315 | float: left; |
| 1316 | margin-right: 0.8em; |
| 1317 | } |
| 1318 | |
1309 | 1319 | .activity-list .activity-item.newest_mentions_activity, .activity-list .activity-item.newest_friends_activity, .activity-list .activity-item.newest_groups_activity, .activity-list .activity-item.newest_blogs_activity { |
1310 | 1320 | background: rgba(31, 179, 221, 0.1); |
1311 | 1321 | } |