Ticket #7762: 7762.patch
File 7762.patch, 1.6 KB (added by , 6 months ago) |
---|
-
wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
301 301 // Add output filters and actions. 302 302 add_filter( 'bbp_get_view_link', array( $this, 'get_view_link' ), 10, 2 ); 303 303 add_filter( 'bbp_breadcrumbs', array( $this, 'breadcrumbs' ) ); 304 add_filter( 'bbp_get_breadcrumb', array( $this, 'add_my_topics_link' ) ); 304 305 305 306 // Handle new topic form at the bottom of support view. 306 307 add_action( 'wporg_compat_after_single_view', array( $this, 'add_topic_form' ) ); … … 713 714 } 714 715 715 716 /** 717 * Add "My Topics" link to the breadcrumbs. 718 */ 719 public function add_my_topics_link( $r ) { 720 if ( ! bbp_is_single_view() ) { 721 return $r; 722 } 723 724 $view = bbp_get_view_id(); 725 if ( ! in_array( $view, $this->compat_views() ) ) { 726 return $r; 727 } 728 729 // Add "My Topics" link after "Reviews" 730 if ( 'reviews' == $view ) { 731 $current_user = wp_get_current_user(); 732 $my_topics_url = esc_url( 'https://wordpress.org/support/users/' . $current_user->user_nicename . '/topics/' ); 733 $r[] = sprintf( 734 '<a href="%s" class="bbp-breadcrumb-forum">%s</a>', 735 $my_topics_url, 736 __( 'My Topics', 'wporg-forums' ) 737 ); 738 } 739 740 return $r; 741 } 742 743 /** 716 744 * Add the new topic form at the bottom of appropriate views; the reviews view 717 745 * form addition is handled by Ratings_Compat. 718 746 */