Opened 14 years ago
Closed 8 years ago
#3108 closed enhancement (wontfix)
allow themes to customize BuddyPress before it loads
Reported by: | ptahdunbar | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 1.5 |
Component: | Core | Keywords: | close |
Cc: |
Description
BuddyPress allows you to customize various aspects of the plugin and other custom BP components by bp-custom.php within the WP_CONTENT_DIR directory.
I suggest adding additional logic for BP to check within the active theme's directory for bp-custom.php too, to make customizations on a theme-by-theme basis easier.
Attachments (2)
Change History (13)
#2
follow-up:
↓ 3
@
14 years ago
The problem with this is that plugins can change what the current parent/child theme are. A plugin which does that might load either before or after BuddyPress which would produce unpredictable results.
#3
in reply to:
↑ 2
;
follow-up:
↓ 4
@
14 years ago
Replying to wpmuguru:
The problem with this is that plugins can change what the current parent/child theme are. A plugin which does that might load either before or after BuddyPress which would produce unpredictable results.
if you mean modifying the current theme directory for the site, then can't we consider that as the edge case? As on most of the sites, a site admin usually does not use a plugin which modifies the current theme(may be I am overlooking a few plugins like the mobile one), rather we expect them to activate the theme of their choice.
#4
in reply to:
↑ 3
@
14 years ago
Replying to sbrajesh:
if you mean modifying the current theme directory for the site, then can't we consider that as the edge case?
Not the directory, filtering the stylesheet (and/or template) option. Mobile support is an instance where that is done. A second thing to keep in mind is that in a WP network, that code runs on all the sub sites as well as the BP blog. I've used a plugin to switch sub sites away from a specific theme to alternate one on several occasions.
#5
@
14 years ago
- Summary changed from allow bp-custom.php to exists in the active theme's directory to allow themes to customize BuddyPress before it loads
#8
@
12 years ago
- Keywords needs-refresh added; has-patch dev-feedback removed
- Severity set to normal
#9
@
11 years ago
Revisiting this ticket (3 years later!) I think it's not the worst idea, but I do want to sort out the ramifications of the edge case that wpmuguru raises above. ticket.3108.2.diff should address many of the cases of forced-theme-changes. That's because it uses the get_stylesheet_directory()
and _template_
functions, both of which are built from data that is passed through a number of the filters that would logically be used for this kind of theme-switching technique.
What do others think? Is this worth pursuing? Are there remaining edge cases that have not been addressed?
#10
@
8 years ago
- Keywords close added; needs-refresh removed
If a theme needs this functionality, they can add it themselves in their own theme's functions.php
file:
function my_after_theme_setup_bp_mods() {
if ( ! function_exists( 'buddypress' ) ) {
return;
}
require dirname( __FILE__ ) . '/functions-buddypress.php';
}
add_action( 'after_setup_theme', 'my_after_theme_setup_bp_mods' );
Themes that include some form of BuddyPress functionality are probably already doing some form of BP check anyway.
s/WP_CONTENT_DIR/WP_CONTENT_DIR/plugins/
ticket.3108.diff does the job.