Forum url changes
-
Hi,
I have WP V5.8 and bbPress V5.0 with OceanWP theme.
I have a custom function.php file in which I control access to pages by user role. For example user_role1 may only access pages with /user_role1/ in the url path.
I have then added a custom forum page called qaforums.
In the bbPress settings I have made this as my Forum Root.
I have then added /qaforums/forum/ and /qaforums/topic/ as permitted paths for user_role1.
Now here is where things get strange.
Let’s say I have a range of forums with the permalinks:
mywebsite.com/qaforums/forum/forum_name1/
mywebsite.com/qaforums/forum/forum_name2/
mywebsite.com/qaforums/forum/forum_name3/
etc.In theory, my user access rules should permit users to see these forums. However, they don’t.
What I discovered is that in order for my access rules to work I need to include permalink /forum_name3/ in the permitted paths list.
In testing, I discovered that the get_page_link() function on the root forum page returns the path:
mywebsite.com/forum_name3/forum_name3/
instead of
mywebsite.com/qaforums/
forum_name3 happens to be the forum with the highest Forum ID.
So my questions are:
1. Why is the get_page_link() function returning a different url on the the root forum page?
2. Why is the permalink mywebsite.com/qaforums/forum/forum_name3/ being changed to mywebsite.com/forum_name3/forum_name3/ ?
And by the way, the get_the_ID() function confirms the same thing.
Any help in understanding this would be appreciated.
Thanks!
- You must be logged in to reply to this topic.