Skip to:

plugin-template.php and BP 1.2

  • Profile photo of peter-anselmo
    Peter Anselmo


    Hi all,

    After digging around for a while, I realized my plugin was breaking on 1.2 because it uses the default “plugin-template.php” file which is not included in the 1.2 default theme.

    It seems keeping this file would be an easy way to add a lot of compatibility with existing plugins. I used it per the suggestion in the current buddypress skeleton component.

    Are we trying to encourage plugin developers to always include template files? Or is this an oversight?


Viewing 5 replies - 1 through 5 (of 5 total)
  • Profile photo of peter-anselmo
    Peter Anselmo


    I now see there are generic plugin template files within the groups and members directories. I take it this is the new best practice?

    Thank you, I just spent a couple of hours trying to figure out this.


    Yes. I’ve just had a look at the code and for example the settings screen works like this:

    add_action( 'bp_template_title', 'bp_core_screen_general_settings_title' );

    add_action( 'bp_template_content', 'bp_core_screen_general_settings_content' );

    bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) ); //this is the plugins.php file

    There are plugin templates for members and groups since these are two distinct objects. This will allow for better customization and support for varying layouts depending on the object in question.

    If you are using the group extension API then your plugin should auto switch to using the new template. If you’ve used something else, then you will need to sniff for the files and use the appropriate one.

    Profile photo of jeremyltn


    @DJPaul – thanks so much for posting that, probably saved me 3 hours.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘plugin-template.php and BP 1.2’ is closed to new replies.
Skip to toolbar