Skip to:
Content

BuddyPress.org

Ticket #7321: 7321.patch

File 7321.patch, 2.3 KB (added by sanket.parmar, 8 years ago)
  • bp-activity/bp-activity-filters.php

     
    450450         */
    451451        $append_text    = apply_filters( 'bp_activity_excerpt_append_text', __( '[Read more]', 'buddypress' ) );
    452452
    453         /**
    454          * Filters the excerpt length for the activity excerpt.
    455          *
    456          * @since 1.5.0
    457          *
    458          * @param int $value Number indicating how many words to trim the excerpt down to.
    459          */
    460         $excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
     453        $excerpt_length = bp_activity_get_excerpt_length();
    461454
    462455        $args = wp_parse_args( $args, array( 'ending' => __( '…', 'buddypress' ) ) );
    463456
  • bp-activity/bp-activity-template.php

     
    26972697                 * @param string $value   The excerpt for the latest update.
    26982698                 * @param int    $user_id ID of the queried user.
    26992699                 */
    2700                 $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ), $user_id );
     2700                $latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], bp_activity_get_excerpt_length() ) ) ), $user_id );
    27012701
    27022702                $latest_update = sprintf(
    27032703                        '%s <a href="%s">%s</a>',
  • bp-core/bp-core-template.php

     
    840840        }
    841841
    842842/**
     843 * Get excerpt length for the activity.
     844 *
     845 * @since 2.8.0
     846 *
     847 * @return int Number indicating how many words to trim the excerpt down to.
     848 */
     849function bp_activity_get_excerpt_length() {
     850
     851        /**
     852         * Filters the excerpt length for the activity excerpt.
     853         *
     854         * @since 2.8.0
     855         *
     856         * @param int $value Number indicating how many words to trim the excerpt down to.
     857         */
     858        return apply_filters( 'bp_activity_excerpt_length', 358 );
     859
     860}
     861
     862/**
    843863 * Truncate text.
    844864 *
    845865 * Cuts a string to the length of $length and replaces the last characters