Ticket #2171: bbpress-profile-url-shortcode.patch
File bbpress-profile-url-shortcode.patch, 2.0 KB (added by , 11 years ago) |
---|
-
includes/common/shortcodes.php
89 89 'bbp-login' => array( $this, 'display_login' ), // Login 90 90 'bbp-register' => array( $this, 'display_register' ), // Register 91 91 'bbp-lost-pass' => array( $this, 'display_lost_pass' ), // Lost Password 92 'bbp-profile-link' => array( $this, 'display_profile_link' ), // User Profile URL 92 93 93 94 /** Others *******************************************************/ 94 95 … … 738 739 bbp_get_template_part( 'form', 'user-lost-pass' ); 739 740 else 740 741 bbp_get_template_part( 'feedback', 'logged-in' ); 741 742 742 743 // Return contents of output buffer 743 744 return $this->end(); 744 745 } 745 746 747 public function display_profile_link() { 748 749 // Unset globals 750 $this->unset_globals(); 751 752 // Start output buffer 753 $this->start( 'bbp_profile_link' ); 754 755 // Output templates 756 if ( is_user_logged_in() ) 757 bbp_get_template_part( 'user', 'profile-url' ); 758 759 // Return contents of output buffer 760 return $this->end(); 761 762 } 763 764 746 765 /** Other *****************************************************************/ 747 766 748 767 /** -
templates/default/bbpress/user-profile-url.php
1 <?php 2 3 /** 4 * User Profile 5 * 6 * @package bbPress 7 * @subpackage Theme 8 */ 9 10 ?> 11 12 <?php do_action( 'bbp_template_before_user_profile_url' ); ?> 13 14 <div id="bbp-user-profile-url" class="bbp-user-profile-url"> 15 <a href="<?php bbp_user_profile_url( bbp_get_user_id( 0, false, true ) ); ?>"><?php _e( 'Your Forums Profile', 'bbpress' ); ?></a> 16 </div><!-- #bbp-user-profile-url --> 17 18 <?php do_action( 'bbp_template_after_user_profile_url' ); ?>