Changeset 5674 for trunk/src/includes/topics/template.php
- Timestamp:
- 04/15/2015 02:10:20 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/topics/template.php
r5563 r5674 2565 2565 ), 'get_topic_edit_link' ); 2566 2566 2567 $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) ); 2567 // Get the topic 2568 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 2568 2569 2569 2570 // Bypass check if user has caps … … 2577 2578 2578 2579 // Get uri 2579 $uri = bbp_get_topic_edit_url( $ r['id']);2580 $uri = bbp_get_topic_edit_url( $topic->ID ); 2580 2581 2581 2582 // Bail if no uri … … 2586 2587 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-edit-link">' . $r['edit_text'] . '</a>' . $r['link_after']; 2587 2588 2588 return apply_filters( 'bbp_get_topic_edit_link', $retval, $r );2589 return apply_filters( 'bbp_get_topic_edit_link', $retval, $r, $args ); 2589 2590 } 2590 2591 … … 2616 2617 global $wp_rewrite; 2617 2618 2618 $bbp = bbpress();2619 2620 2619 $topic = bbp_get_topic( bbp_get_topic_id( $topic_id ) ); 2621 2620 if ( empty( $topic ) ) { … … 2628 2627 // Pretty permalinks 2629 2628 if ( $wp_rewrite->using_permalinks() ) { 2630 $url = trailingslashit( $topic_link ) . $bbp->edit_id;2629 $url = trailingslashit( $topic_link ) . bbp_get_edit_rewrite_id(); 2631 2630 $url = trailingslashit( $url ); 2632 2631 2633 2632 // Unpretty permalinks 2634 2633 } else { 2635 $url = add_query_arg( array( bbp_get_topic_post_type() => $topic->post_name, $bbp->edit_id=> '1' ), $topic_link );2634 $url = add_query_arg( array( bbp_get_topic_post_type() => $topic->post_name, bbp_get_edit_rewrite_id() => '1' ), $topic_link ); 2636 2635 } 2637 2636 … … 2693 2692 ), 'get_topic_trash_link' ); 2694 2693 2695 $actions = array(); 2696 $topic = bbp_get_topic( bbp_get_topic_id( (int) $r['id'] ) ); 2694 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 2697 2695 2698 2696 if ( empty( $topic ) || ! current_user_can( 'delete_topic', $topic->ID ) ) { 2699 2697 return; 2700 2698 } 2699 2700 $actions = array(); 2701 2701 2702 2702 if ( bbp_is_topic_trash( $topic->ID ) ) { … … 2713 2713 $retval = $r['link_before'] . implode( $r['sep'], $actions ) . $r['link_after']; 2714 2714 2715 return apply_filters( 'bbp_get_topic_trash_link', $retval, $r );2715 return apply_filters( 'bbp_get_topic_trash_link', $retval, $r, $args ); 2716 2716 } 2717 2717 … … 2762 2762 ), 'get_topic_close_link' ); 2763 2763 2764 $topic = bbp_get_topic( bbp_get_topic_id( (int)$r['id'] ) );2764 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 2765 2765 2766 2766 if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) { … … 2773 2773 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-close-link">' . $display . '</a>' . $r['link_after']; 2774 2774 2775 return apply_filters( 'bbp_get_topic_close_link', $retval, $r );2775 return apply_filters( 'bbp_get_topic_close_link', $retval, $r, $args ); 2776 2776 } 2777 2777 … … 2823 2823 ), 'get_topic_approve_link' ); 2824 2824 2825 $topic = bbp_get_topic( bbp_get_topic_id( (int)$r['id'] ) );2826 2827 if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) {2825 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 2826 2827 if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) { 2828 2828 return; 2829 2829 } … … 2834 2834 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-approve-link">' . $display . '</a>' . $r['link_after']; 2835 2835 2836 return apply_filters( 'bbp_get_topic_approve_link', $retval, $r );2836 return apply_filters( 'bbp_get_topic_approve_link', $retval, $r, $args ); 2837 2837 } 2838 2838 … … 2885 2885 ), 'get_topic_stick_link' ); 2886 2886 2887 $topic = bbp_get_topic( bbp_get_topic_id( (int)$r['id'] ) );2887 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 2888 2888 2889 2889 if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) { … … 2911 2911 $retval = $r['link_before'] . $stick_display . $super_display . $r['link_after']; 2912 2912 2913 return apply_filters( 'bbp_get_topic_stick_link', $retval, $r );2913 return apply_filters( 'bbp_get_topic_stick_link', $retval, $r, $args ); 2914 2914 } 2915 2915 … … 2955 2955 ), 'get_topic_merge_link' ); 2956 2956 2957 $topic = bbp_get_topic( bbp_get_topic_id( (int)$r['id'] ) );2957 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 2958 2958 2959 2959 if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) { … … 2964 2964 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-merge-link">' . $r['merge_text'] . '</a>' . $r['link_after']; 2965 2965 2966 return apply_filters( 'bbp_get_topic_merge_link', $retval, $ args );2966 return apply_filters( 'bbp_get_topic_merge_link', $retval, $r, $args ); 2967 2967 } 2968 2968 … … 3013 3013 ), 'get_topic_spam_link' ); 3014 3014 3015 $topic = bbp_get_topic( bbp_get_topic_id( (int)$r['id'] ) );3015 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 3016 3016 3017 3017 if ( empty( $topic ) || ! current_user_can( 'moderate', $topic->ID ) ) { … … 3024 3024 $retval = $r['link_before'] . '<a href="' . esc_url( $uri ) . '" class="bbp-topic-spam-link">' . $display . '</a>' . $r['link_after']; 3025 3025 3026 return apply_filters( 'bbp_get_topic_spam_link', $retval, $r );3026 return apply_filters( 'bbp_get_topic_spam_link', $retval, $r, $args ); 3027 3027 } 3028 3028 … … 3063 3063 3064 3064 // Get the reply to use it's ID and post_parent 3065 $topic = bbp_get_topic( bbp_get_topic_id( (int)$r['id'] ) );3065 $topic = bbp_get_topic( bbp_get_topic_id( $r['id'] ) ); 3066 3066 3067 3067 // Bail if no reply or user cannot reply … … 3753 3753 if ( ! empty( $term->term_id ) ) { 3754 3754 3755 $bbp = bbpress();3756 3757 3755 // Pretty 3758 3756 if ( $wp_rewrite->using_permalinks() ) { 3759 $retval = user_trailingslashit( trailingslashit( bbp_get_topic_tag_link() ) . $bbp->edit_id);3757 $retval = user_trailingslashit( trailingslashit( bbp_get_topic_tag_link() ) . bbp_get_edit_rewrite_id() ); 3760 3758 3761 3759 // Ugly 3762 3760 } else { 3763 $retval = add_query_arg( array( $bbp->edit_id=> '1' ), bbp_get_topic_tag_link() );3761 $retval = add_query_arg( array( bbp_get_edit_rewrite_id() => '1' ), bbp_get_topic_tag_link() ); 3764 3762 } 3765 3763
Note: See TracChangeset
for help on using the changeset viewer.