Ticket #3722: 3722.patch
File 3722.patch, 2.4 KB (added by , 7 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-hooks.php
4 4 5 5 class Hooks { 6 6 7 private $has_new_topic_button = false; 8 7 9 const SITE_URL_META = '_wporg_bbp_topic_site_url'; 8 10 9 11 public function __construct() { … … 241 243 * Displays a link to the new topic form. 242 244 */ 243 245 public function new_topic_link() { 244 if ( bbp_is_single_forum() ) {246 if ( bbp_is_single_forum() && bbp_current_user_can_access_create_topic_form() && ! $this->has_new_topic_button ) { 245 247 printf( '<a class="button create-topic" href="#new-topic-0">%s</a>', __( 'Create Topic', 'wporg-forums' ) ); 248 249 /* 250 * The $has_new_topic_button class variable prevents us from adding the create topic button 251 * multiple times on the same page in cases where the pagination links are used more than once. 252 * 253 * This avoids adding a create button at the bottom of the page, next to the create form. 254 */ 255 $this->has_new_topic_button = true; 246 256 } 247 257 } 248 258 -
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-support/sidebar.php
25 25 <?php bb_base_single_forum_description(); ?> 26 26 <li><a class="feed" href="<?php bbp_forum_permalink(); ?>feed/"><?php _e( 'Recent Posts', 'wporg-forums' ); ?></a></li> 27 27 <li><a class="feed" href="<?php bbp_forum_permalink(); ?>feed/?type=topic"><?php _e( 'Recent Topics', 'wporg-forums' ); ?></a></li> 28 <?php if ( bbp_current_user_can_access_create_topic_form() ) : ?>29 <li class="create-topic"><a href="#new-post"><?php _e( 'Create Topic', 'wporg-forums' ); ?></a></li>30 <?php endif; ?>31 28 <?php if ( is_user_logged_in() && $forum_subscription_link = bbp_get_forum_subscription_link() ) : ?> 32 29 <li class="forum-subscribe"><?php echo $forum_subscription_link; ?></li> 33 30 <?php endif; ?>