Skip to:
Content

BuddyPress.org

Changeset 7447


Ignore:
Timestamp:
10/19/2013 07:56:43 PM (11 years ago)
Author:
r-a-y
Message:

Blogs: Modify recorded post permalink to use shortlink.

Previously, when BuddyPress recorded the post permalink in the
activity stream, it would use the current permalink structure of the blog.

The problem with this is if the blog changed its permalink structure,
the post permalink in the activity post would not resolve properly
because of the change.

This commit alters the recorded post permalink to use the shortlink
(domain/?p=POST_ID). Because WP's rewrite rules will pick up the
'p' query parameter and redirect to the proper post permalink, this
will ensure that the post permalink for future activity blog posts
will work as intended.

Fixes #4367.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-functions.php

    r7409 r7447  
    289289
    290290            // Record this in activity streams
    291             $post_permalink   = get_permalink( $post_id );
     291            $post_permalink = add_query_arg(
     292                'p',
     293                $post_id,
     294                trailingslashit( get_home_url( $blog_id ) )
     295            );
    292296
    293297            if ( is_multisite() )
Note: See TracChangeset for help on using the changeset viewer.