Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/22/2011 08:30:22 PM (14 years ago)
Author:
boonebgorges
Message:

Adds Read More functionality to activity comments. Adds AJAX functionality to activity Read More. Fixes #2635. Fixes bugs with the way that activity comment content and meta links are displayed. Fixes #3168.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r4230 r4239  
    320320add_action( 'wp_ajax_activity_mark_unfav', 'bp_dtheme_unmark_activity_favorite' );
    321321
     322/**
     323 * AJAX handler for Read More link on long activity items
     324 *
     325 * @package BuddyPress
     326 * @since 1.3
     327 */
     328function bp_dtheme_get_single_activity_content() {
     329    $activity_array = bp_activity_get_specific( array(
     330        'activity_ids'      => $_POST['activity_id'],
     331        'display_comments'  => 'stream'
     332    ) );
     333   
     334    $activity = !empty( $activity_array['activities'][0] ) ? $activity_array['activities'][0] : false;
     335   
     336    if ( !$activity )
     337        exit(); // todo: error?
     338   
     339    // Activity content retrieved through AJAX should run through normal filters, but not be
     340    // truncated
     341    remove_filter( 'bp_get_activity_content_body', 'bp_activity_truncate_entry', 5 );
     342    $content = apply_filters( 'bp_get_activity_content_body', $activity->content );
     343   
     344    echo $content;
     345   
     346    exit();
     347}
     348add_action( 'wp_ajax_get_single_activity_content', 'bp_dtheme_get_single_activity_content' );
     349
    322350/* AJAX invite a friend to a group functionality */
    323351function bp_dtheme_ajax_invite_user() {
Note: See TracChangeset for help on using the changeset viewer.