Tagged: 1.5 plugin update Toggle Comment Threads | Keyboard Shortcuts

  • Boone B. Gorges 8:17 pm on September 5, 2011 Permalink | Reply
    Tags: , 1.5 plugin update, , BP_Group_Extension, , navigation   

    If your plugin or theme manually manipulates the navigation tabs in individual groups, either through the use of functions like bp_core_new_subnav_item() and bp_core_remove_subnav_item() or through the direct manipulation of $bp->bp_options_nav, you’ll want to know about some changes in BP 1.5.

    Due to an oversight long ago, in BP 1.2.x, the key ‘groups’ (or, more precisely, $bp->groups->slug) was used to store two totally different nav items in $bp->bp_options_nav: the ‘Groups’ item on a user’s profile, and the main navigation of an individual group (Admin, Forums, Members, etc), an overlap that caused incorrect navigation to be rendered in some cases. In BP 1.5, this inconsistency has been rectified by moving individual group navigation items from $bp->bp_options_nav['groups'] to a new array position, keyed by the group slug. So if your group has the slug boone-for-president, the navigation for the Boone For President group will be stored at $bp->bp_options_nav['boone-for-president']

    What does this mean for you? If you use the BP_Group_Extension class – which is true for the vast majority of plugins that create group navigation – you will not be affected (because the BP_Group_Extension class builds navigation for you, and takes this change into account). You may be affected if, like Jonnyauk was attempting to do, you’re using bp_core_remove_nav_item() to take stuff out of the group nav, like this:

    function bbg_remove_send_invites_from_group() {
    	global $bp;
    	bp_core_remove_nav_item( $bp->groups->slug, 'send-invites' );
    }
    add_action( 'bp_setup_nav', 'bbg_remove_send_invites_from_group' );
    

    which won’t work anymore. Do this instead:

    function bbg_remove_send_invites_from_group() {
    	bp_core_remove_nav_item( bp_get_current_group_slug(), 'send-invites' );
    }
    add_action( 'bp_setup_nav', 'bbg_remove_send_invites_from_group' );
    

    Navigation for profiles, and elsewhere in BuddyPress, has not changed; the advice above is only relevant for groups (or custom components that have single items – Achievements comes to mind, meaning that if you are manually manipulating the single-Achievement subnav, you’ll need to make similar modifications.)

     
    • Boone B. Gorges 9:24 pm on September 5, 2011 Permalink | Reply

      I forgot to mention that if you need to keep 1.2.x compatibility in a plugin, you can try this method:

      $parent_slug = isset( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ? $bp->groups->current_group->slug : $bp->groups->slug;
      bp_core_remove_nav_item( $parent_slug, 'send-invites' );

      That should cover both 1.2.x and 1.5+.

      • Tim Carey 10:16 pm on October 28, 2011 Permalink | Reply

        Try this method where

      • Leland 5:22 pm on January 11, 2012 Permalink | Reply

        Boone,

        Could you put in the full code for this? I have been trying to hack this updated group tab code for hours and nothing is working. Adding to functions file. Thanks.

    • Stas Sușcov 10:45 pm on September 5, 2011 Permalink | Reply

      Another thing to mention, since this post was about group component, if you were using in your plugins $bp->groups->slug to check for current page component, you should change that to $bp->groups->id since slug and component id refer to absolutely different information:
      1. to group component permalink slug
      2. to group component id itself

      As an example, if you’ve mapped groups component to a page called classes, your code will never work!

    • Johan 10:28 pm on September 27, 2011 Permalink | Reply

      Thanks for the info, guys. Can you please give me an example of how to ADD stuff to the menu option, as well?

      Cheers

    • Tim Carey 9:50 pm on October 28, 2011 Permalink | Reply

      Could someone please explain how to use bp_groups_default_extension to make your default group tab

    • Johnny 5:12 am on November 2, 2011 Permalink | Reply

      Also, could someone explain how to change a group tab slug too?

      Cheers

      Johnny

    • Chris 8:12 pm on April 29, 2012 Permalink | Reply

      Hi Boone,

      In your original post I think you have an error after ‘Do this instead:’ ….

      bp_core_remove_nav_item(….

      should read:

      bb_core_remove_subnam_item(…

      I’m also interested in what method you would recommend using for re-ordering the subnav items, e.g. renaming ‘Home’ to ‘Activities’ and moving ‘Forum’ to the start of the sub-nav

      And also changing the default subnav item (e.g. to Forum) in the example above, so that all other links to the group default to that subnav?

      Kind regards

      Chris

      • Chris 8:15 pm on April 29, 2012 Permalink | Reply

        (ignore this reply – I forgot to click notify boxes before I clicked reply)

    • Irmy 11:59 am on October 28, 2012 Permalink | Reply

      indisputable very good informative, good explanation! thanks

    • Vexpress 7:47 am on November 7, 2012 Permalink | Reply

      great info! …any idea how to add stuff to menu option?

    • make money using 3:48 pm on March 20, 2013 Permalink | Reply

      I am really impressed together with your writing abilities
      and also with the format on your blog. Is this a paid subject matter or did you customize it yourself?
      Either way keep up the nice high quality writing, it’s uncommon to peer a great weblog like this one today..

    • Chris 4:16 pm on April 18, 2013 Permalink | Reply

      You need a (better?) spam filter, Boone…. Time to unsubscribe :(

  • Boone B. Gorges 9:17 pm on August 12, 2011 Permalink | Reply
    Tags: , 1.5 plugin update, bp_blogs_record_comment(), comments, custom post types   

    There was a quirk in the way that BuddyPress 1.2.x’s Blogs component recorded posts and comments in the activity stream. With you published a new post, it only got published in the activity stream if $post->post_type == 'post'. In other words, Pages and all custom post types were ignored. On the other hand, no such post_type check took place in the case of comments, with the result that comments on pages and other post types did show up in the stream.

    This odd inconsistency was fixed in the BuddyPress trunk with changeset 4959; BuddyPress now checks to make sure that the item being commenting on is a WordPress ‘post’ before adding the comment to the activity stream. However, anointed chimed in to let us know that some BuddyPress admins were taking advantage of the quirk. The result of this discussion is r4971, in which the post type checks are enhanced by turning them into checks against a filterable whitelist.

    Plugin authors should be aware of this changed default behavior. If your plugin creates custom post types, and if you want comments on those custom post types to be recorded in the BP activity stream by bp_blogs_record_comment() (if you are using your own function for this purpose, you don’t need to worry about the change), you will have to update your plugin to do something like this:

      function bbg_record_my_custom_post_type_comments( $post_types ) {
          $post_types[] = 'dolphin'; // Add your custom post type name to the array. If you have a post type called 'dolphin' then you have a weird plugin
          return $post_types;
      }
      add_filter( 'bp_blogs_record_comment_post_types', 'bbg_record_my_custom_post_type_comments' );
    

     
    • Dianakc 4:24 am on August 13, 2011 Permalink | Reply

      Newbie question: BP or WordPress plugins should add this filter?

      • Boone B. Gorges 2:55 pm on August 13, 2011 Permalink | Reply

        Any plugin that wants to record comments on custom post types in the BP activity stream using bp_blogs_record_comment(). If any of the following are true about your plugin, then this post does *not* apply to you:

        • your plugin has nothing to do with BuddyPress
        • your plugin does not use a custom post type to store data
        • your plugin uses a custom post type, but does not use comments on those CPTs
        • you have manually unhooked bp_blogs_record_comment(), and are recording CPT comments with your own custom function

        (In short, it really only applies to a small number of existing plugins.)

        • stevenkword 4:43 pm on December 30, 2011 Permalink

          @Boone — Great solution. This helped me out today. Thanks!

    • Simon 5:47 pm on August 17, 2011 Permalink | Reply

      Question for you Boone, so let’s say you have a WP / BP site where your primary “members” can create posts. Does the above functionality (function bbg_record_my_custom_post_type_comments) imply that both post creation and commenting on posts can be integrated into the activity stream?

      caus that would be really cool.

      • Simon 5:49 pm on August 17, 2011 Permalink | Reply

        Further to that last question….

        Are there any caveats within the new 1.5 framework to tie custom post types to groups?

        i.e. create a new post in a group?

    • landwire 7:01 am on September 11, 2011 Permalink | Reply

      Keep me informed on this.

    • Johan 2:37 pm on September 26, 2011 Permalink | Reply

      Hm, I can’t get this working. I’ve tried adding the bit of code above (after replacing “dolphin” with my custom post type) to the plugin files, functions.php and bp-custom.php but no luck.

      Comments made on my custom post type pages does not appear in the activity stream. Any ideas?

      Thanks

    • Johan 10:31 am on October 11, 2011 Permalink | Reply

      Bump. Anyone have an idea of why my custom post type comments won’t show up in the activity stream? Any suggestions on how to troubleshoot?

      Thanks!

      • Anthony 5:05 pm on January 10, 2012 Permalink | Reply

        Same here. Would love to get this working

    • Mika "Ipstenu" Epstein 1:12 pm on October 11, 2011 Permalink | Reply

      Johan – This is the wrong place to post that. You should post in the support forum.

    • Garry 5:46 pm on September 19, 2012 Permalink | Reply

      Hey Boone – bothered you through email; how best to make a custom activity show up on a wall — ie this and the new blogs post activity show upon save — I’m doing a voting plugin and want to post that so and so voted on poll once they vote….

    • deepan 10:46 am on December 14, 2012 Permalink | Reply

      Hi All, iam using Lazyest gallery for site wide, but when buddy press users comments on this, it updates in commenting but not activity i need solution to this can you people elaborately giving any external plugins to integrate with buddy press.

      many thanks,

    • syiria rumana 6:42 am on June 19, 2013 Permalink | Reply

      Wow, fantastic blog layout! How long have you been running a blog for? you make running a blog look easy. The full look of your website is magnificent, let alone the content!

  • Boone B. Gorges 6:59 pm on August 9, 2011 Permalink | Reply
    Tags: , 1.5 plugin update, abstraction, bp_is_current_component(), bp_is_group(), bp_is_groups_component(), BuddyPress Group Email Subscription   

    In a few of the previous posts in the 1.5 plugin update series, I’ve talked about maintaining backward compatibility with earlier versions of BP while upgrading your plugins for BP 1.5. In those posts, I suggest the function_exists() method, which will always work nicely.

    However, there’s another method you might want to consider: update your plugin as if you weren’t going to support earlier versions of BP, and then conditionally include an abstraction file that defines the necessary functions. Here’s what I mean.

    When I was upgrading BuddyPress Group Email Subscription for BP 1.5, I wanted to make use of a few BP 1.5-only functions: namely, bp_is_groups_component() and bp_is_group(). So I did. Then, I created a new file called 1.5-abstraction.php, which looks like this. You’ll notice that I haven’t copied the functions directly over from the 1.5 source. The main reason for this (especially in the case of bp_is_groups_component()) is that the original function references bp_is_current_component(), which in turn has a bunch of complicated logic that is not necessary in my case. So, in my case, it made sense to take a minute to write less general functions from scratch. However, I could just as easily have copied these two functions directly into my abstraction file.

    Then, I loaded the 1.5-abstraction.php file conditionally, like so:

    if ( defined( 'BP_VERSION' ) && version_compare( BP_VERSION, '1.5-beta-1', '<' ) ) {
    	require_once( dirname( __FILE__ ) . '/1.5-abstraction.php' );
    }

    In this way, I only load the file when necessary.

    The nice thing about this method is that my main codebase remains clean and easy to read. When I decide to drop backward compatibility for early versions of BP, this file can simply be removed from the package.

    Another great thing about these abstraction files is that we can share them. Feel free to copy the small one from BP Group Email Subscritpion into your own plugin and build upon it – and share your own version with other developers.

     
    • Ray 7:12 pm on August 9, 2011 Permalink | Reply

      I just use `version_compare( BP_VERSION, ’1.3′ ) < 0`, which does the same thing, but I don't have to type out the long beta string ;)

    • Boone B. Gorges 7:39 pm on August 9, 2011 Permalink | Reply

      Smart :)

    • modemlooper 7:44 pm on August 9, 2011 Permalink | Reply

      but Apple has made it trendy to drop support and make things obsolete older than 6 months.

    • Stas Sușcov 8:09 am on August 10, 2011 Permalink | Reply

      Hey,
      I was thinking maybe bpdevel team should release those functions into a plugin?

      • Boone B. Gorges 4:41 pm on August 10, 2011 Permalink | Reply

        It’s a big job, and will create a really big file with functions that will be unnecessary for most plugins. That said, if someone wants to step up and do it, they are more than welcome :)

  • Boone B. Gorges 7:00 pm on August 6, 2011 Permalink
    Tags: 1.5 plugin update   

    Over the next few weeks, a series of posts will appear on this blog, featuring developer notes on upgrading your plugins and themes for BP 1.5. Follow the series at the 1.5 plugin update tag.

     
  • Boone B. Gorges 2:25 pm on August 5, 2011 Permalink | Reply
    Tags: , 1.5 plugin update, , bp_setup_globals, bp_setup_nav   

    In version 3.1, WordPress began enforcing a restriction against using is_page(), and other conditional functions that leverage $wp_query, before the init action. Prior to version 1.5, BuddyPress was one of the violators of this restriction – BP’s global- and navigation-setup routines, which required reference to $wp_query, were hooked to plugins_loaded, well before init. This transgression was corrected in r3742, where the main BP hooks (bp_setup_globals, bp_setup_nav, and the like) were switched from plugins_loaded to init. See #2609 for further discussion.

    What does this mean for BuddyPress plugins and themes? The good news is that the change will be invisible and seamless for most. However, the change in load order does have some implications for functions like bp_core_remove_nav_item() and other functions that only work properly once the global- and navigation-setup routines are finished. That’s because, with the switch to init, your plugin files as well as your theme’s functions.php are now loaded before BP sets up its globals and nav.

    In practical terms, BP 1.2.x erroneously allowed you to put the following line directly into a plugin file or functions.php, into the global scope:

    bp_core_remove_subnav_item( 'activity', 'friends' );

    This will no longer work. Modifications to BP navigation should be done inside of a function hooked to bp_setup_nav, with the priority of 10 or higher. So the previous code becomes:

    function bbg_remove_activity_friends_subnav() {
        bp_core_remove_subnav_item( 'activity', 'friends' );
    }
    add_action( 'bp_setup_nav', 'bbg_remove_activity_friends_subnav', 15 );

    Likewise, any modifications to the $bp global should be hooked to bp_setup_globals.

    See #3438 for more discussion. Many thanks to sbrajesh for raising the issue.

     
    • miguel dias 3:43 pm on August 5, 2011 Permalink | Reply

      is it me or all our buddypress sites will stop working when bp 1.5 arrives >_< seems like a lot of changes that should have been inserted progressively and not on one go, i use a custom theme bp theme and like 12 plugins, txxx ill have tons of work fixing everything if i can… just to make it work.

      and nothing on bp roadmap of features for 1.5 is anything to call home about, mostly tweaks and fixes, not saying that buddypress has to be a facebook/myspace/twitter clone, but as of now… im not sure what it is… im probably dropping my buddypress for something else when bp 1.5 arrives…

      • modemlooper 4:37 pm on August 5, 2011 Permalink | Reply

        BP 1.5 has more core work than features. The core work is to move BuddyPress to a better place in the WordPress ecosystem. This will make it easier for upgrades and to not have a theme break because it’s custom.

        As for not sure what BuddyPress is comment, it’s what ever you want it to be and that is the beauty in it.

      • DennisSmolek 5:24 pm on August 5, 2011 Permalink | Reply

        @miguel, It isn’t breaking all the sites and plugins. I’ve actually been upgrading sites to 1.5(1.3) for a while to check compatibility with some sites we run. I’ve found that most of the time there arnt any issues, but I’ve been waiting for 1.5 to get real in depth.

        As any WP site goes you know that plugins get abandoned, especially the free ones. BP was really susceptible to this. So if you have a solid setup you dont think you’ll need to change then stick with what you have.

        The reality, and I get it now, is that BP can do everything, so you can turn off what you dont want. It’s not trying to be a clone, but more a list of possibilities.

        • miguel dias 10:18 pm on August 5, 2011 Permalink

          with the last 2 buddypress updates, it broke my site, first time i had to rollback and wait about a week for the theme creator to update and the next one i fixed it myself, and i use a pretty popular budypress theme from wpmudev, so yeah… it might not, but im sure it will…

          and in reality any program can do anything, you just have to program it, in the case of BP the basic feature set is not even on par with the basic feature set of other free social network scripts and even the pretty inventive twists are mostly fails, like the groups forums, the twitterish stream, the social profiles… im basically just stating all the feature set, as a basic social network buddypress is a fail and there are no plugins/themes that can fix that!

          and i’ve been running a successful buddypress site for a while now…

        • miguel dias 11:13 pm on August 5, 2011 Permalink

          right well, whats the point of having buddypress and then having most features turned off.. and i already contribute what i can with bp as well as talking on the development blog should be the place to talk about this, to talk with the people developing it, if i have a bug i go to the trac if i have a feature or plugin to contribute or to talk about i would go to bp website, why not talk here about the development?

          and if you don’t think that all my “throwing my hands up in air” talk is constructive feedback, well i also don’t think you actually gave me constructive feedback, just justifications for why things are as they are, and i would think buddypress devs would be interested in the opinions of users like me that have large buddypress communities…

          you talk to me like i’ve just started using buddypress and im disappointed, after more than year using buddypress by now i know quite a bit about buddypress good and bad, i’ve spent countless hours on buddypress.org, on tweaking my buddypress site, my buddypress themes and had countless discussion… come on… i read the BuddyPress Development Blog!!!

          no but yeah its my fault i used buddypress components and i should have spent more time choosing my theme correctly and choosing my configuration better, if its bad i should have fixed it myself, yeah its my fault

          NOW! you can call me up on my throwing my hands up in air…

        • Boone B. Gorges 12:28 pm on August 6, 2011 Permalink

          miguel – As the admin of a highly used BP site, your feedback is *extremely* valuable. And the fact that you have negative feedback makes it even *more* valuable. However, criticism you’ve leveraged against BP in comments on this post can be summed up pretty much like this:
          1) BuddyPress groups, group forums, activity streams, Twitter-style at-mentions, and profiles are all “fail”.
          2) BuddyPress’s basic feature set is not on a par with other free social network scripts

          Point (1) sounds to me like it basically dismisses all of BuddyPress. It’s fine if you don’t like these features, but they are really the root of what makes BP powerful. If there’s something specific about their implementation that makes them fail, please post a bug ticket, or at least a concrete idea about how they could be improved. Point (2) is extremely vague: What are the other scripts you’re talking about, and what features do they have that BP does not have?

          Negative feedback is extremely helpful, when it’s specific and well-explained. “BP is a bucket of fail and every other social networking tool is better” is not helpful. That’s all I mean when I ask for “constructive criticism”.

        • Quint Rahaman 10:48 pm on August 7, 2011 Permalink

          Nicely stated, Boone! Miguel, this after all is a “community” and in that spirit, hopefully the following helps you to better help the Buddypress folks/contributors help you and everyone else. Oh, Miguel, I am new to the WordPress and Buddypress world.

          With regard to feedback, “specificity” is a critical element upon which understanding and subsequent action can be taken. Without it, context has not been established. Personally, all I get from your posts is that you’re frustrated but I have no idea why. Furthermore, maybe I missed it but I did not see any reference to Beta 2 of Buddypress 1.5 issues, etc.

          And since you’ve been in the Buddypress world way longer than I, the following analogy should work for you. Let’s pretend that the Buddypress developers are the “markup”; that is, they represent the html documents that contain the content. If you want the content to be styled according to your vision, you must “style” it. And assuming inline styling isn’t being used, the only way to style it is to use cascading style sheets. Furthermore, having empty cascading style sheets or using non-css syntax applies nothing to the markup, and thus your vision for how the content should look/perform (however spectacular it may be), goes nowhere. And for as brilliant as these guys are, they can’t read minds.

          And in this regard, specifically, feedback is being sought on Buddypress 1.5, Beta 2, a rule I broke by replying to you here. If you want to reply to me regarding what I have written, please do so through email since this would be off topic.

    • Boone B. Gorges 6:51 pm on August 5, 2011 Permalink | Reply

      Yeah, I think it’s a bit excessive to say that “all our buddypress sites will stop working”. The issue described in this post will only affect a very small number of plugins/themes, and of those, only those that were coded incorrectly to begin with. After we work out some of the kinks during these beta periods (which is the purpose of beta periods, after all) I think everyone will be quite surprised with how backward-compatible we are.

      • miguel dias 10:09 pm on August 5, 2011 Permalink | Reply

        sorry im not speaking necessarily of this issue and sorry for hijacking the comment thread >_< but the reason me and most people love wordpress is for its simplicity, updates are a breeze, even if plugins fail its normally a easy fix, even complex themes are easy to create and update, everything is simple and coherent.

        on the other end buddypress like bbpress is a mess, plugins break all the time, themes are convoluted and complicated and the feature set is from complete fail to awesomeness, there is no basic social feature set, its muddled and confusing, and i've been using buddypress for more than a year now and what i get from my users is resentment for a not so good experience, i have 4000+ members and the only part of the site that they all love is the only part that is not powered by buddypress, after a lot of complaining (for months) after i turned the site to buddypress i had to bring back the smf forum and that alone is whats keeping the community together for all this time, the site has lots of traffic and lots of users and no one cares or uses their profiles (what profiles???) no one talks on the stream (its @ like twitter? noo noo you use the name? what?), the groups is a mess lots of people join, say hello, then nothing… this goes on and on…

        so i kinda feel like taking the bullet and starting over with something else and just quit buddypress, and its not only me… so yeah its excessive that all buddypress will stop working with bp 1.5 but bp 1.5 doesnt make buddypress that much better…

        • Boone B. Gorges 10:36 pm on August 5, 2011 Permalink

          BuddyPress is a community project. If you think BuddyPress, and its plugins, and its themes, are “a mess”, then you should contribute in the form of patches or constructive feedback. Throwing your hands in the air in frustration, on the development blog, during the beta period leading up to a release, is not constructive.

          Also, the fact that you have left all components on, and it’s turned out to be bad for your community, is not an indictment against BuddyPress. Take the time to configure the site to the needs of your community. Just as WordPress installations must have their themes chosen carefully to best suit the blog content, so too must BP installations have their configurations chosen carefully to suit the community’s needs.

        • John James Jacoby 9:01 pm on August 6, 2011 Permalink

          If you knew you were hijacking things, then you should have stopped at that point.

          Please post future off-topic opinionated rants somewhere else (your own blog?) and not our tool for discussing specific developer centric topics.

    • T. J. Brumfield 6:04 am on August 6, 2011 Permalink | Reply

      Out of curiousity, in bp-core-buddybar.php it looks like you’re calling bp_core_remove_subnav_item without a hook to bp_setup_nav.

      Am I not looking at this correctly, or was there a reason for this?

      • Boone B. Gorges 12:17 pm on August 6, 2011 Permalink | Reply

        If you mean around line 319, in the function bp_core_remove_nav_item(), then the explanation is this: This instance of bp_core_remove_subnav_item() is meant to remove all the subnav items when someone removes a parent item. We’re assuming that the parent item will be removed properly, ie that bp_core_remove_nav_item() will be called correctly, in a function hooked to bp_setup_nav.

    • Nicolas Galarza Ricci 6:56 pm on December 19, 2012 Permalink | Reply

      Hi! I’m trying (for a while) to remove some tabs from the groups inside my site. I want to remove the Home, so the only way to interact in the group would be inside the forum. ANd the send invites.

      Honestly I don’t have a clue, about where to insert the code.

      Could anybody help me?

      thank u very much!!!!

  • Boone B. Gorges 3:52 pm on July 31, 2011 Permalink | Reply
    Tags: , 1.5 plugin update   

    As I discussed in a recent post, BP 1.5′s slug setup is a bit different. To ensure full compatibility with all BP 1.5 setups (and specifically, those with hierarchical page structures – such as http://buddypress.org/community/groups), you’ll need to change the way you concatenate links.

    The most straightfoward way to do this is by using BP 1.5′s new bp_get_x_root_slug() functions, eg
    $group_admin_link = bp_get_root_domain() . bp_get_groups_root_slug() . '/' . $this_group_slug . '/admin';

    However, using bp_get_groups_root_slug() means that your plugin will not work with earlier versions of BP, which will show a fatal ‘undefined function’ error. If you need to continue to support earlier versions of BP, you might want to think about assembling your links like this:

    global $bp;
    $group_slug = function_exists( 'bp_get_groups_root_slug' ) ? bp_get_groups_root_slug() : $bp->groups->slug;
    $group_admin_link = bp_get_root_domain() . $group_slug . '/' . $this_group_slug . '/admin';

    Similarly, the recommended way to check for the current component in BP 1.5 is to use the component-specific functions:

    if ( bp_is_groups_component() ) { ...

    or, for arbitrary components,

    if ( bp_is_current_component( $component_slug_or_root_slug ) ) { ...

    However, if you need to retain backward compatibility for the moment, try something like the following:

    if ( ( function_exists( 'bp_is_groups_component' ) && bp_is_groups_component() ) || $bp->current_component == $bp->groups->slug ) { ...

    I’ll probably be doing this myself with some of my more popular plugins, as a stopgap release until I feel more comfortable dropping backward compatibility with pre-1.5 installations of BuddyPress.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel
Follow

Get every new post delivered to your Inbox.

Join 331 other followers

%d bloggers like this: