Skip to:
Content

BuddyPress.org

Changeset 5030


Ignore:
Timestamp:
08/24/2011 07:18:57 PM (13 years ago)
Author:
boonebgorges
Message:

Cleans up use of bp_create_excerpt(). Fixes #3503. Props r-a-y

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-template.php

    r4989 r5030  
    483483
    484484    return apply_filters( 'bp_create_excerpt', $truncate, $original_text, $length, $options );
    485 }
    486 add_filter( 'bp_create_excerpt', 'wp_trim_excerpt' );
     485
     486}
    487487add_filter( 'bp_create_excerpt', 'stripslashes_deep' );
    488488add_filter( 'bp_create_excerpt', 'force_balance_tags' );
  • trunk/bp-forums/bp-forums-template.php

    r4961 r5030  
    724724
    725725        $defaults = array(
    726             'length' => 45
     726            'length' => 225
    727727        );
    728728
     
    732732        $post = bp_forums_get_post( $forum_template->topic->topic_last_post_id );
    733733        $post = bp_create_excerpt( $post->post_text, $length );
    734         return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post );
     734
     735        return apply_filters( 'bp_get_the_topic_latest_post_excerpt', $post, $length );
    735736    }
    736737
    737738function bp_the_topic_time_since_last_post() {
    738     global $forum_template;
    739 
    740739    echo bp_get_the_topic_time_since_last_post();
    741740}
  • trunk/bp-groups/bp-groups-template.php

    r4998 r5030  
    504504            $group =& $groups_template->group;
    505505
    506         return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description, 20 ) );
     506        return apply_filters( 'bp_get_group_description_excerpt', bp_create_excerpt( $group->description ) );
    507507    }
    508508
  • trunk/bp-members/bp-members-template.php

    r4961 r5030  
    571571
    572572        $defaults = array(
    573             'length'    => 70,
     573            'length'    => 225,
    574574            'view_link' => true
    575575        );
    576576
    577577        $r = wp_parse_args( $args, $defaults );
    578         extract( $r, EXTR_SKIP );
    579 
    580         if ( !isset( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) )
     578        extract( $r );
     579
     580        if ( empty( $members_template->member->latest_update ) || !$update = maybe_unserialize( $members_template->member->latest_update ) )
    581581            return false;
    582582
    583         $update_content = apply_filters( 'bp_get_activity_latest_update', sprintf( _x( '- "%s"', 'member latest update in member directory', 'buddypress' ), trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) ) );
    584 
    585         if ( $view_link && !empty( $update['id'] ) && bp_is_active( 'activity' ) )
    586             $update_content .= ' <a href="' . bp_get_root_domain() . '/' . bp_get_activity_root_slug() . '/p/' . $update['id'] . '">' . __( 'View', 'buddypress' ) . '</a>';
     583        $update_content = apply_filters( 'bp_get_activity_latest_update_excerpt', sprintf( _x( '- &quot;%s &quot;', 'member latest update in member directory', 'buddypress' ), trim( strip_tags( bp_create_excerpt( $update['content'], $length ) ) ) ) );
     584
     585        // If $view_link is true and the text returned by bp_create_excerpt() is different from the original text (ie it's
     586        // been truncated), add the "View" link.
     587        if ( $view_link && ( $update_content != $update['content'] ) ) {
     588            $view = __( 'View', 'buddypress' );
     589
     590            $update_content .= '<span class="activity-read-more"><a href="' . bp_activity_get_permalink( $update['id'] ) . '" rel="nofollow">' . $view . '</a></span>';
     591        }
    587592
    588593        return apply_filters( 'bp_get_member_latest_update', $update_content );
  • trunk/bp-themes/bp-default/members/members-loop.php

    r4858 r5030  
    4949                    <?php if ( bp_get_member_latest_update() ) : ?>
    5050
    51                         <span class="update"> <?php bp_member_latest_update( array( 'length' => 10, 'view_link' => false ) ); ?></span>
     51                        <span class="update"> <?php bp_member_latest_update(); ?></span>
    5252
    5353                    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.