Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/16/2015 06:59:09 PM (10 years ago)
Author:
djpaul
Message:

Activity: improve blog post excerpts by showing rich media from the post.

Prior to this change, when we created excerpts for new/updated blog post activity items, we'd try to use any single image referenced in that blog post, and use it to decorate and bring interactivity to the activity stream item. This was inconsistently applied -- it was dependant on the length of the original post -- and ignored other possible media sources, such as oEmbeds and video/audio shortcodes.

Now, we use the media extractor (r9619) to extract comprehensive media information from a new/updated blog post, and use the information to build a much richer excerpt for blogs posts for activity items.

See #6177

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-activity.php

    r9471 r9621  
    353353    $r = wp_parse_args( $args, $defaults );
    354354
    355     // Remove large images and replace them with just one image thumbnail
    356     if ( ! empty( $r['content'] ) ) {
    357         $r['content'] = bp_activity_thumbnail_content_images( $r['content'], $r['primary_link'], $r );
    358     }
    359 
    360355    if ( ! empty( $r['action'] ) ) {
    361356
     
    377372         * @since BuddyPress (1.2.0)
    378373         *
    379          * @param string $value Generated excerpt from content for the activity stream.
     374         * @param string $value Generated summary from content for the activity stream.
    380375         * @param string $value Content for the activity stream.
    381376         * @param array  $r     Array of arguments used for the activity stream item.
    382377         */
    383         $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_create_excerpt( $r['content'] ), $r['content'], $r );
     378        $r['content'] = apply_filters( 'bp_blogs_record_activity_content', bp_activity_create_summary( $r['content'], $r ), $r['content'], $r );
    384379    }
    385380
Note: See TracChangeset for help on using the changeset viewer.