Forum Replies Created
In fact, ideally we’d like to override what check_is_friend() does, without hacking the core file.
is this possible?
Okay case solved.
I added another action to after_setup_theme() at priority 20 for registering more ajax actions. Created a custom ajax.php script and required it in the FIRST after_setup_theme() hook for my custom template.
Created a test action of
'addremove_friend' => 'custom_ajax_addremove_friend'and echo’d test content. All works as expected 🙂
Okay, In which case I’d like to override the some of the core ajax functions within this script. Is it as simple as adding filters or would I have to create a new file & folder buddypress/buddypress-functions.php and write a new set of ajax actions?
Okay I’ve found the solution. However I’m confused as to why ajax.php isn’t where the functions are being called. It appears buddypress-functions.php is where the magic happens. This confuses me slightly, what is the point in ajax.php if its never being used? The function run is : “bp_legacy_theme_ajax_addremove_friend”
bump, apparently I posted this over a year ago! (I only posted it today)
okay so it has “register_sidebar()”, I can use that. My problem is related to the fact that I’m using widgets to display a Sub Menu that can be defined using the Menus admin. I can then choose the menu to display, and the widget will display it. That menu needs to change on a per page basis. (hence the need for a different set of widgets per page)
Many apologies, When I set the “Activity Streams” Page in BP settings to “None” (deactivate, should have been clearer on that), then I get my sidebar back. When I set “Activity Streams” to one of my existing pages, I can see the Activity Stream just fine, but the widgets in the sidebar no longer display, and is_active_sidebar() is returning FALSE.
I use BP theme compatibility because I am not using an existing WordPress template. It is completely bespoke. I don’t override the default behaviour as I am happy with it using page.php for now.
However I may have just seen my problem. I am using a plugin called “WordPress Page Widgets” which lets me specify a different set of widgets on a per page basis. If I apply the sidebar widgets to every page the default way it works fine. However it is incredibly important that each page has a different set of widgets, and WordPress doesn’t appear to have a way of doing this without the need for a plugin.