How do I stop BP from overriding default parameters passed to the template loop?
For example, on the Activity page, let's say you want BP to "forget" the user's last viewed parameter (like "My Forums" or "@user Mentions") and go right back to All Members or My Friends every time you reload the page.
I tried deleting the contents of ajax.php and global.js, and the overriding behavior still happens. How do I stop BP from doing this?
Buzu B answers:
You are not familiar with buddypress you should start here
buddypress saves cookies that indicate which activity stream tab you last selected. When you return to that page, the user is forced back to that tab, rather than the default tab. What I am trying to do is ovErride that behavor so the default tab is always selected.
oops, reply output got buffered. Above reply should read: "IF you are not familiar..."
moderator, please edit if possible (no edit option available to me - my reply look inadventently rude!)
The function that handles this is bp_init_activity(). If you comment the call to this function out (around line 15 of global.js), it should stop the cookie from overriding your default settings.
Buzu B comments:
Nice!, I'm glad you found the solution. Now I just want to point out the location of global.js in case anybody has the same question but doesn't know where to find the file. The file is not in the plugin files but in the bp-default theme files. You need to use a buddypress compatible theme when using budypress, and buddypress comes with a default theme which you need to put in your themes directory. The file global.js is located in that wp-default theme, inside the _inc folder, so if you have already moved bp-default theme to your themes directory on wp, the file should be located on
Now, 3sixty, I guess there is no reason for the question to be open, I guess you could close it. Again, I'm glad you were able to find the answer on your own, good luck!
hmm, I don't see a way to close the question... if there is a way to do it, the link is not obvious (or else I am oblivious)
Buzu B comments:
Humm.. I wouldn't know. I have never asked. But I guess, in that case just let the time run off.