[buddypress-trac] [BuddyPress] #4855: Method to override a plugins use of plugins.php or add filters to bp_template_title and bp_template_content
buddypress-trac
noreply at wordpress.org
Wed Mar 6 20:12:05 UTC 2013
#4855: Method to override a plugins use of plugins.php or add filters to
bp_template_title and bp_template_content
------------------------------------+-----------------------
Reporter: modemlooper | Owner:
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 1.7
Component: Theme | Version: 1.7
Severity: normal | Resolution:
Keywords: has-patch dev-feedback |
------------------------------------+-----------------------
Comment (by imath):
Hi modemlooper, r-a-y, boone,
As i'm not sure to understand all that have been discussed so far, i
apologize if i'm wrong with the following.
A few time ago, i've worked on one of my plugin (bp-checkins) in order to
be sure it will load correctly on bp-default / bp-legacy. Then as it
worked i've published some content in the [http://codex.buddypress.org
/theme-compatibility/how-to-enjoy-bp-theme-compat-in-plugins/ codex] that
describes the way i've done it. I haven't noticed the trouble you refer to
in members area.
So i'm a bit confused, i hope i haven't missed something!!
So i've checked again with bbPress activated and everything works fine.
I think boone is right when saying:
> can you give an example of an existing plugin...
It's always easier to understand when seeing the trouble in action ;)
----
>My issue is this and that every theme can have a custom legacy
plugins.php
modemlooper, i avoid this problem by using a custom name for my template
on the same way that describes boone
[https://buddypress.trac.wordpress.org/ticket/4855#comment:4 here]
I first reference my plugin's path in the stack if my component is the
current one and add a hook into the member screen callback if theme is not
bp-default to include the filter
{{{
function bp_plugin_user_screen_callback(){
//bp-default
bp_core_load_template( apply_filters(
'bp_plugin_user_screen_callback', 'bp-plugin-main-user-template' ) );
//if BP Default is not used, we filter bp_get_template_part
if( !bp_plugin_is_bp_default() )
add_filter( 'bp_get_template_part', 'bp4855', 10, 2 );
}
}}}
PS: i'll need to update the condition to include a
current_theme_support('buddypress') check
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4855#comment:25>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list