Changeset 8955
- Timestamp:
- 08/22/2014 03:43:26 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-activity/bp-activity-template.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r8787 r8955 2593 2593 2594 2594 $url = wp_nonce_url( $url, 'bp_activity_delete_link' ); 2595 2595 2596 2596 return apply_filters( 'bp_get_activity_delete_url', $url ); 2597 2597 } … … 2764 2764 $activity_action = bp_get_activity_action_name(); 2765 2765 switch ( $activity_action ) { 2766 2766 2767 2767 // Maybe turn off for blog and forum updates 2768 2768 case 'new_blog_post' : … … 2793 2793 * false. 2794 2794 */ 2795 function bp_activity_can_comment_reply( $comment ) {2795 function bp_activity_can_comment_reply( $comment = '' ) { 2796 2796 2797 2797 // Assume activity can be commented on 2798 2798 $can_comment = true; 2799 2799 2800 // Fall back on current comment in activity loop 2801 $comment_depth = isset( $comment->depth ) 2802 ? intval( $comment->depth ) 2803 : bp_activity_get_comment_depth(); 2804 2805 // Threading is turned on, so check the depth 2806 if ( get_option( 'thread_comments' ) ) { 2807 $can_comment = (bool) ( $comment_depth < get_option( 'thread_comments_depth' ) ); 2808 2809 // No threading for comment replies if no threading for comments 2810 } else { 2811 $can_comment = false; 2812 } 2813 2814 return apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment ); 2800 // Check that comment exists 2801 if ( empty( $comment ) ) { 2802 $comment = bp_activity_current_comment(); 2803 } 2804 2805 if ( ! empty( $comment ) ) { 2806 2807 // Fall back on current comment in activity loop 2808 $comment_depth = isset( $comment->depth ) 2809 ? intval( $comment->depth ) 2810 : bp_activity_get_comment_depth(); 2811 2812 // Threading is turned on, so check the depth 2813 if ( get_option( 'thread_comments' ) ) { 2814 $can_comment = (bool) ( $comment_depth < get_option( 'thread_comments_depth' ) ); 2815 2816 // No threading for comment replies if no threading for comments 2817 } else { 2818 $can_comment = false; 2819 } 2820 } 2821 2822 return (bool) apply_filters( 'bp_activity_can_comment_reply', $can_comment, $comment ); 2815 2823 } 2816 2824 … … 2869 2877 return apply_filters( 'bp_get_total_favorite_count_for_user', $retval ); 2870 2878 } 2871 2879 2872 2880 2873 2881 /** … … 3189 3197 */ 3190 3198 function bp_activity_recurse_comments_user_ids( array $comments = array() ) { 3191 3199 3192 3200 // Default user ID's array 3193 3201 $user_ids = array(); … … 3360 3368 if ( bp_is_profile_component() || bp_is_current_action( 'just-me' ) ) { 3361 3369 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/feed/'; 3362 3370 3363 3371 // Friend feed link 3364 3372 } elseif ( bp_is_active( 'friends' ) && bp_is_current_action( bp_get_friends_slug() ) ) { 3365 3373 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_friends_slug() . '/feed/'; 3366 3374 3367 3375 // Group feed link 3368 } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { 3376 } elseif ( bp_is_active( 'groups' ) && bp_is_current_action( bp_get_groups_slug() ) ) { 3369 3377 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/' . bp_get_groups_slug() . '/feed/'; 3370 3378 … … 3372 3380 } elseif ( 'favorites' === bp_current_action() ) { 3373 3381 $link = bp_displayed_user_domain() . bp_get_activity_slug() . '/favorites/feed/'; 3374 3382 3375 3383 // Mentions activity feed link 3376 3384 } elseif ( ( 'mentions' === bp_current_action() ) && bp_activity_do_mentions() ) {
Note: See TracChangeset
for help on using the changeset viewer.