Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/29/2014 01:45:50 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Avoid debug notices in bp_blogs_activity_comment_permalink() when item_id is not set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-activity.php

    r8475 r8712  
    851851 * @return string
    852852 */
    853 function bp_blogs_activity_comment_permalink( $retval ) {
     853function bp_blogs_activity_comment_permalink( $retval = '' ) {
    854854    global $activities_template;
    855855
    856     if ( isset( buddypress()->blogs->allow_comments[$activities_template->activity->current_comment->item_id] ) ){
     856    // Get the current comment ID
     857    $item_id = isset( $activities_template->activity->current_comment->item_id )
     858        ? $activities_template->activity->current_comment->item_id
     859        : false;
     860
     861    // Maybe adjust the link if item ID exists
     862    if ( ( false !== $item_id ) && isset( buddypress()->blogs->allow_comments[ $item_id ] ) ) {
    857863        $retval = $activities_template->activity->current_comment->primary_link;
    858864    }
Note: See TracChangeset for help on using the changeset viewer.