Remove copypasta from BP_Groups_Member::get_invite_count_for_user()

See r8057

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8061 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Change default per_page for bp_group_has_invites() to false

This change is necessary for backward compatibility, as the old internals
did not have pagination parameters. See eg bp-default.

See #5423

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8062 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Introduce pagination for Send Invites page in single groups

For better support for up-to-date pagination, the AJAX for group invitations
now refreshes the entire invitation section, rather than simply adding single
items to/removing single items from the DOM. This change requires a new
template, groups/single/invite-loop.php, which is the item loaded by the AJAX
request. Backward compatibility with bp-default-style themes is maintained in
the JS.

Fixes #5423

Props dcavins

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8063 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8063

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8064 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Add integration tests for bp_group_has_membership_requests()

These tests check to see that the results of a default query are correct, and
that the results are formatted as expected. This is in anticipation of
refactoring related to #5440

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8065 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Code quality improvements to BP_Group_Membership_Requests_Template

- Refactor constructor to accept params as an associative array
- Don't use extract() in constructor
- Docblock

See #5440

Props dcavins

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8066 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8066

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8067 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Core: merge custom body classes with WordPress' defaults.

Until 1.9, we overrode all the custom body classes that are added to the theme, and replaced them with BuddyPress-specific classes.
With 1.9 in r7663, we manually added a couple of WordPress core classes back to fix compatibility problems with certain themes (notably, Twenty Fourteen). However, body classes added by other plugins were still removed.

This change merges BuddyPress' body classes into those provided by WordPress core, and those from any other plugins.

Fixes #4929 and #5204

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8068 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Replace internals of BP_Group_Membership_Requests_Template with BP_Group_Member_Query

This brings us more in line with the Invites template functions, and is another
step toward centralizing all of our group queries.

The change also allows for true pagination. This changeset also adds the 'page'
parameter to the stack.

See #5440

Props dcavins

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8069 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Messages: Introduce template functions for getting and outputting the last message in a single thread when in the inbox/sentbox loop. Props boonebgorges. Fixes #5176.

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8070 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Streamline COUNT query in BP_Activity_Activity::get

It's unnecessary to use an ORDER BY clause when counting, and the index hint
was doing more harm than good, especially in cases where a specific ID was
passed.

See #5448

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8071 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8071

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8072 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improved management of new_blog_post activity items at transition_post_status

Introduces bp_blogs_catch_transition_post_status(). This function, which
replaces bp_blogs_catch_published_post(), performs a similar task - determining
when a new blog post has been published, and recording the post in the activity
stream - but adds a corrolary for unpublishing that deletes the activity item.

Unit tests and deprecated function are included.

See #5333

Props henry.wright for an initial patch

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8073 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8073

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8074 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Normalize cache priming in BP_Activity_Activity::get_activity_data()

No need to reproduce logic in bp_get_non_cached_ids(). This brings the caching
strategy in line with other components.

See #5434

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8075 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Improved cache invalidation when posting activity comments

- Because activity comment caches are stored only with the top-level parent,
  we should be invalidating the bp_activity_comments cache for that item, not
  for the immediate parent
- When a new comment is created, clear the bp_activity cache for each
  ancestor

See #5434

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8076 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
POT, generated from r8076

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8077 cdf35c40-ae34-48e0-9cc9-0c9da1808c22