Don't improperly sanitize meta_key in _meta() functions

Many BP meta functions have always stripped certain characters from the
$meta_key parameter before performing their operations. This is a terrible idea
on a number of levels: it doesn't provide any feedback to the user, it silently
performs actions that are not equivalent to the ones intended by the user, and
it doesn't serve any real purpose (since any necessary sanitization happens at
the level of $wpdb). Moreover, it wasn't even applied consistently across all
functions. A truly delightful grab bag.

This changeset removes the sanitization, and updates the necessary unit tests
to reflect the change.

See #5399

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8129 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't trim whitespace from $meta_value param in _delete_meta() functions

The $meta_value parameter of BP's delete_meta() functions allows developers to
limit deletion to rows that match both the $meta_key *and* the specified
$meta_value. However, most of BP's delete_meta() functions have always had a
quirk whereby the $meta_value was run through trim() before matching against
the values in the database. This had the unacceptable side effect that passing
a $meta_value of '  foo  ' would delete rows with the value 'foo', but *not*
the value '  foo  '!

This changeset reverses the behavior, and modifies the relevant unit tests.

See #5399

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8130 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Return an empty string from get_meta() functions when no value is found

BP get_meta() functions have been inconsistent about the type of value returned
when no match is found for the object_id+meta_key combination. In some cases,
we followed WP's get_metadata() and returned an empty string. In others, we
returned false.

This changeset aligns all of our get_meta() functions with WP in this regard,
returning an empty string when no matching value is found. A boolean false is
still returned when invalid arguments are passed to the functions.

Relevant unit tests have been updated, including strict assertSame() checking
where appropriate.

See #5399

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8131 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
In update_meta() functions, return integer value if a new metadata is created

Previously, BP update_meta() functions returned true on a successful update
*or* on the successful creation of new metadata. This is not consistent with
WP's update_metadata(), which on the creation of new metadata acts as a wrapper
for add_metadata(), which in turn returns an integer (the ID of the newly
created database row).

This changeset aligns BP's behavior with WP's.

We don't have any tests that directly address the data type returned by these
functions, but we do have a number of assertTrue assertions to verify the
setup of various tests. Where appropriate, these have been changed to the more
generous assertNotEmpty.

See #5399

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8132 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Use WP's array format for get_meta() functions when no $meta_key is provided

Passing only an object_id to a get_meta() function in WP will return an array
of arrays, keyed by meta_keys, each containing a list of meta_values for that
meta_key. BP's get_meta() functions were inconsistent in this regard: some
returned arrays of stdClass, some returned one-d arrays of meta_values. All
returned values that were practically of little use, because they didn't have
enough information about the located data to make it useful.

This changeset aligns BP's get_meta() functions with WP's. We now allow the
return value of get_metadata() to pass through untouched in all cases. Unit
tests have been updated as necessary.

See #5399

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8133 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
More consistent whitespace in meta functions

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8134 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Remove unnecessary parameter sanitization from meta functions

WP's meta API functions already perform the necessary sanitization.

See #5399

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8135 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Display a Manage Signups submenu to Users menu in wp-admin

Signups management is simulating a new view in the wp-admin users page. A Pending link is available after the different WordPress views to filter the users by roles. It appears the Signups screen can be a bit difficult to find for site or network administrators. As a result, it is best to display the Manage Signups submenu instead of removing it.

See #5374

props johnjamesjacoby, boonebgorges

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8136 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Don't swap '[User Set]' into welcome emails when accounts are created in the Dashboard

This is incorrect behavior, because when the emails are created when is_admin(),
the password is not set by the user.

The is_admin() exception was mistakenly removed in r6439.

Fixes #5466

Props SergeyBiryukov

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8137 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Use closest() instead of parent() to hide unfavorited activity item

Ancestor-crawling makes for inflexible javascript, which makes for sad developers.

Fixes #5467

Props hnla

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8138 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Check the right capabilities are used in the BP_Admin class

The introduction of the link "About BuddyPress" within the WP Admin Bar revealed that in multisite configurations, some administration menus were accessible to regular administrators when they should be restricted to the Super Administrator.
Now, the capacity used in these menus will be adapted to the configuration in which BuddyPress evolves using a "network" capacity when necessary.

props johnjamesjacoby, boonebgorges, imath

Fixes #5465

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8140 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
bp-legacy: Remove charset attribute for <script> call.

This is invalid HTML.

Fixes #5366

Props henry.wright

git-svn-id: https://buddypress.svn.wordpress.org/trunk@8141 cdf35c40-ae34-48e0-9cc9-0c9da1808c22
Replace wp_parse_args() with bp_parse_args() for all template loops.

bp_parse_args() allows developers to filter the template arguments
before the loop is rendered.  This will allow for greater
flexibility to manipulate template loops in plugins.

See #5306

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

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