Skip to:
Content

BuddyPress.org

Changeset 854 for trunk/bp-blogs.php


Ignore:
Timestamp:
01/16/2009 09:00:46 PM (16 years ago)
Author:
apeatling
Message:

Added filters to all activity and notification formatting functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r847 r854  
    253253            if ( !$user_id )
    254254                return false;
     255           
     256            $blog_url = get_blog_option( $blog->blog_id, 'siteurl' );
     257            $user_link = bp_core_get_userlink($user_id);
     258            $blog_name = get_blog_option( $blog->blog_id, 'blogname' );
    255259               
    256260            return array(
    257                 'primary_link' => get_blog_option( $blog->blog_id, 'siteurl' ),
    258                 'content' => sprintf( __( '%s created a new blog: %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . get_blog_option( $blog->blog_id, 'siteurl' ) . '">' . get_blog_option( $blog->blog_id, 'blogname' ) . '</a>' ) . ' <span class="time-since">%s</span>'
     261                'primary_link' => $blog_url,
     262                'content' => apply_filters( 'bp_blogs_new_blog_activity', sprintf( __( '%s created a new blog: %s', 'buddypress' ), $user_link, '<a href="' . $blog_url . '">' . $blog_name . '</a>' ) . ' <span class="time-since">%s</span>', $user_link, $blog_url, $blog_name )
    259263            ); 
    260264        break;
     
    271275
    272276            $post_link = bp_post_get_permalink( $post, $post->blog_id );
    273             $content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . $post_link . '">' . $post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';     
     277            $user_link = bp_core_get_userlink($user_id);
     278           
     279            $content = sprintf( __( '%s wrote a new blog post: %s', 'buddypress' ), $user_link, '<a href="' . $post_link . '">' . $post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';     
    274280            $content .= '<blockquote>' . bp_create_excerpt($post->post_content) . '</blockquote>';
     281           
     282            $content = apply_filters( 'bp_blogs_new_post_activity', $content, $user_link, $post );
    275283           
    276284            return array(
     
    294302                return false;
    295303               
    296             $post_link = bp_post_get_permalink( $comment->post, $comment->blog_id );
    297             $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), bp_core_get_userlink($user_id), '<a href="' . $post_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';           
     304            $comment_link = bp_post_get_permalink( $comment->post, $comment->blog_id );
     305            $user_link = bp_core_get_userlink($user_id);
     306           
     307            $content = sprintf( __( '%s commented on the blog post %s', 'buddypress' ), $user_link, '<a href="' . $comment_link . '#comment-' . $comment->comment_ID . '">' . $comment->post->post_title . '</a>' ) . ' <span class="time-since">%s</span>';           
    298308            $content .= '<blockquote>' . bp_create_excerpt($comment->comment_content) . '</blockquote>';
     309           
     310            $content = apply_filters( 'bp_blogs_new_comment_activity', $content, $user_link, $comment );
    299311
    300312            return array(
Note: See TracChangeset for help on using the changeset viewer.