@abysshorror – when you say “user/mentions” do you mean a page with a url structure like
https://buddypress.org/community/members/abysshorror/mentions
Assuming you set up the nav item with https://codex.buddypress.org/developer-docs/functions/core/bp_core_new_nav_item/
The next part is to use the screen_function parameter, i learnt how to use it via the admin menu’s codex as the item navs are based off it… https://codex.wordpress.org/Administration_Menus
Here’s a quick example i just wrote, (note: untested and i wrote it really quickly, so dont expect it to work out of the box) [Updated, see below]
To use a php file in it, you would just replace the echos with a require(‘myfile.php’); (or get_template_part) to get the php file inside the screen function.
edited the code as i had left out load template. see here – http://pastebin.com/Zy1bbZi3
@ChrisClayton you are a genius, man !
It worked out of the box
Quick question:
I’ve added your code to functions.php and it loaded perfectly, but I’d like to turn it into a function (so it’s a little less messy ). What hook should I use ? (I mean which `add_action()` )
Thabk you so much again !
@ChrisClayton I’m still working on this
An issue I’ve noticed is that for some reason I cannot find, some activity buttons like add to favorites or comment are not working. For example, if I try to add an activity update to my favorites, it actually sends me to the URL http://mysite.com/activity/favorite/218/?_wpnonce=a067fd9559
I’ve checked and the URL is the exact same one that appears on other screens and the link works just fine (it applies some jQuery, I believe) but on this new page it takes me to that URL which is a 404.
Thank you again