Correct way to setup BP_Theme_Compat class for custom theme

What’s the correct procedure going forward (1.8+) to setup a theme that makes use of BP Theme Compatibility, but wants to significantly amend / remove some of the various filters / actions that BP_Legacy adds?

I know I can do this by creating my own class named BP_Legacy in my theme and customising, but this doesn’t seem a correct approach.

If I use a custom class name, e.g. class MY_Theme_Compat extends BP_Theme_Compat, how do I stop an instance of BP_Legacy also being created (and registering its actions that I don’t want)?

Also, if I define a custom Theme_Compat class in my theme, can I still access ‘fallback’ templates from BP_Legacy – if so, is this built in default behaviour, or do I need to configure my class globals accordingly?

‘register_theme_packages’ is probably the approach, but has to be looked into as will need some work doing to it, probably filters for bp_get_theme_package_id() and a lot of testing before it’s a viable there’s a fair bit of hardcoding going on that needs to be filterable?. Had a brief chat with Boone about this as need to prepare a overview best practise guide to all approaches one can take with custom themes/sites.

For the moment I think one re-declares the class even if that might feel wrong – it works!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Correct way to setup BP_Theme_Compat class for custom theme’ is closed to new replies.