Skip to:

Opened 11 years ago

Closed 6 years ago

#5272 closed enhancement (maybelater)

Use $args parameter on BP_Blogs instead of 8 variables

Reported by: lenasterg's profile lenasterg Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Blogs Keywords: needs-testing, needs-unit-tests, needs-refresh, trac-tidy-2018


I think it would be nice if we could change the way the BP_Blogs, BP_Blogs_Blog is constructed and use the $args parameter instead of 8 variables (Similar to BP_Activity).
I know it is a major shift, but I can give it a try, if is is OK as suggestion.

Thanks in advance

Attachments (7)

bp-blogs-classes.php (25.0 KB) - added by lenasterg 10 years ago.
bp-blogs-classes.php file with suggested changes
bp-blogs-template.php (40.5 KB) - added by lenasterg 10 years ago.
bp-blogs-template.php file with suggested changes
bp-blogs-functions.php (35.1 KB) - added by lenasterg 10 years ago.
bp-blogs-functions.php file with suggested changes
bp-blogs-classes.php.patch (12.6 KB) - added by lenasterg 10 years ago.
Patched file /bp-blogs/bp-blogs-classes.php
bp-blogs-functions.php.patch (3.3 KB) - added by lenasterg 10 years ago.
bp-blogs-template.php.patch (6.0 KB) - added by lenasterg 10 years ago.
Patched file /bp-blogs/bp-blogs-template.php
5272.patch (8.3 KB) - added by boonebgorges 10 years ago.

Download all attachments as: .zip

Change History (18)

#1 @DJPaul
11 years ago

  • Milestone changed from Awaiting Review to Future Release

Sure -- obviously, the important thing is to keep backwards compatibility, like we've done in these other places you've mentioned. But it's definitely something that has annoyed many BP devs in the past, and if you want to make a start on this, we'd love to help you get it into the 2.0 early next year.

10 years ago

bp-blogs-classes.php file with suggested changes

10 years ago

bp-blogs-template.php file with suggested changes

10 years ago

bp-blogs-functions.php file with suggested changes

#2 @lenasterg
10 years ago

I'm pretty sure, I use wrong way to send the changes (by 3 file uploads), so I apologize about that :-)

I made the necessary changes following the same concept with BP_activity and I (think) the the backwards compatibility is kept.

Attached are the 3 files with the suggested changes. The changed functions are marked with

@version 2, stergatu

which is only for marking reasons - in order to make it more easy to spot them - and the marks should be deleted if the changes are accepted.

Note the 3 files are based on BP v1.9.2 and also include changes based on (Dropping DISTINCT from some queries).

Hope the changes are OK.

#3 @boonebgorges
10 years ago

  • Keywords needs-refresh added
  • Milestone changed from Future Release to 2.0

Hi lenasterg,

The changes look good at a glance, but it'll be really difficult to apply in this format. Can I ask you to fix some things? A couple tips:

  • The most important thing is to find the setting in your text editor/IDE that is changing whitespace from tabs into spaces and *turn it off*. It's rewriting every single line in the file, which is making it difficult to apply your much more limited changes. If you could do this alone, it would make our lives much easier :)
  • It's best practice to keep fixes separate (such as the DISTINCT fixes you mention). It's easy for me to separate them out of your patch from a technical point of view, but it keeps discussion more focused if they're on their own tickets.
  • Ideally, you'd generate a proper patch. In brief,

Here are a couple helpful pages for getting set up with SVN (Subversion):, They are specific to WordPress, but the process is the same with BuddyPress.

Thanks so much for your contribution! With a refresh, we can get this in for 2.0.

#4 @lenasterg
10 years ago

Thank you so much, for the hints.
I attached the patches.

P.S. I can't delete the 3 php files I initial uploaded.

10 years ago

Patched file /bp-blogs/bp-blogs-classes.php

10 years ago

Patched file /bp-blogs/bp-blogs-template.php

#5 @boonebgorges
10 years ago

  • Keywords needs-testing has-patch needs-unit-tests added; needs-refresh removed

Thanks, lenasterg. In the future, if you could run the 'patch' command from wp-content/plugins/buddypress, that'd create a single patch for all files. And also, if you could *please* turn off whatever in your IDE is using spaces instead of tabs and is stripping whitespace from function arguments, that'd be helpful.

The $args part of this patch looks good at a glance, but it's going to need some unit tests before I feel comfortable making the change. 5272.patch contains a reformatted version of just those changes. I don't have time to continue working on it at the moment.

The patch also contained some show_hidden enhancements throughout the component, as well as some limit/per_page juggling. Neither of these is a bad idea, but they should both be introduced as their own tickets with separate patches. Thanks!

10 years ago

#6 @DJPaul
10 years ago

  • Keywords needs-patch added; has-patch removed

#7 @boonebgorges
10 years ago

  • Milestone changed from 2.0 to 2.1

#8 @DJPaul
10 years ago

  • Keywords early added
  • Milestone changed from 2.1 to 2.2

As no-one has contributed any unit tests so far, and I don't think the core team have enough time to do so at the moment, moving to this 2.2 where we can try to get the change in early.

#9 @DJPaul
10 years ago

  • Keywords needs-refresh added; needs-patch early removed
  • Milestone changed from 2.2 to Future Release

#10 @DJPaul
6 years ago

  • Keywords trac-tidy-2018 added

We're closing this ticket because it has not received any contribution or comments for at least two years. We have decided that it is better to close tickets that are good ideas, which have not gotten (or are unlikely to get) contributions, rather than keep things open indefinitely. This will help us share a more realistic roadmap for BuddyPress with you.

Everyone very much appreciates the time and effort that you spent sharing your idea with us. On behalf of the entire BuddyPress team, thank you.

If you feel strongly that this enhancement should still be added to BuddyPress, and you are able to contribute effort towards it, we encourage you to re-open the ticket, or start a discussion about it in our Slack channel. Please consider that time has proven that good ideas without contributions do not get built.

For more information, see
or find us on Slack, in the #buddypress channel:

#11 @DJPaul
6 years ago

  • Milestone Awaiting Contributions deleted
  • Resolution set to maybelater
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.