Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/06/2013 10:46:43 PM (13 years ago)
Author:
boonebgorges
Message:

Introduces bp_activity_comment_permalink() and implements in comment template

ID anchors have always been available for the purpose of linking directly to
specific activity comments. But these links have never been available directly
in the interface: the timestamp of specific comments lead to the parent thread,
instead of to the specific comment within that thread. This changeset will make
it easier to find the permalink of specific comments.

Fixes #4741

File:
1 edited

Legend:

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

    r7129 r7168  
    20262026
    20272027/**
     2028 * Echoes the activity comment permalink
     2029 *
     2030 * @since BuddyPress (1.8)
     2031 *
     2032 * @uses bp_get_activity_permalink_id()
     2033 */
     2034function bp_activity_comment_permalink() {
     2035    echo bp_get_activity_comment_permalink();
     2036}
     2037    /**
     2038     * Gets the activity comment permalink
     2039     *
     2040     * @since BuddyPress (1.8)
     2041     *
     2042     * @uses bp_activity_get_permalink()
     2043     * @uses apply_filters() To call the 'bp_get_activity_comment_permalink' hook
     2044     *
     2045     * @return string $link The activity comment permalink
     2046     */
     2047    function bp_get_activity_comment_permalink() {
     2048        global $activities_template;
     2049
     2050        $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '#acomment-' . $activities_template->activity->current_comment->id;
     2051
     2052        return apply_filters( 'bp_get_activity_comment_permalink', $link );
     2053    }
     2054
     2055/**
    20282056 * Echoes the activity favorite link
    20292057 *
Note: See TracChangeset for help on using the changeset viewer.