Skip to content

Commit

Permalink
Only logged-in users should see 'New Topic' link in Discussion.
Browse files Browse the repository at this point in the history
See #3475.
  • Loading branch information
boonebgorges committed Dec 27, 2024
1 parent 24e6515 commit c5932d8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions wp-content/themes/openlab/lib/menus.php
Original file line number Diff line number Diff line change
Expand Up @@ -571,12 +571,14 @@ function openlab_group_forum_submenu() {
$base_url => 'All Topics'
];

if ( is_user_logged_in() ) {
$menu_list += [
$base_url . '#new-post' => 'New Topic'
];
}

$current_item = $base_url;
if ( bp_is_action_variable( 'topic', 0 ) ) {
$menu_list += [
$base_url . '#new-post' => 'New Topic'
];

$bbp = bbpress();

// Forum data
Expand Down Expand Up @@ -605,10 +607,6 @@ function openlab_group_forum_submenu() {

$current_item = bbp_get_topic_permalink();
}
} else {
$menu_list += [
'#new-post' => 'New Topic'
];
}

if ( isset( $_GET['bbp_search'] ) ) {
Expand Down

0 comments on commit c5932d8

Please sign in to comment.