User strategy for interfacing with User Engagements.
This strategy largely exists for backwards compatibility with bbPress 2.5, or installations that have not upgraded their databases to 2.6 or above.
Note: this strategy is going to be a bit less tidy than the others, because it needs to do weird things to maintain the 2.5 status-quo. Do not use this strategy as an example when building your own.
| since | 2.6.0 bbPress (r6844) |
|---|---|
| package | bbPress |
| inherited_from | \BBP_User_Engagements_Base |
add_user_to_object(integer $object_id= 0, integer $user_id= 0, string $meta_key= '', string $meta_type= 'post', boolean $unique= false) : boolean
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::add_user_to_object() |
integerThe object id.
integerThe user id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanWhether meta key should be unique to the object.
booleanReturns true on success, false on failure.add_user_to_object(integer $object_id= 0, integer $user_id= 0, string $meta_key= '', string $meta_type= 'post', boolean $unique= false) : boolean
| since | 2.6.0 bbPress (r6722) |
|---|
integerThe object id.
integerThe user id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanWhether meta key should be unique to the object.
booleanReturns true on success, false on failure.get_query(array $args= array(), $context_key= '', string $meta_key= '', string $meta_type= 'post') : array
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::get_query() |
array
string
string
arrayget_query(array $args= array(), $context_key= '', string $meta_key= '', string $meta_type= 'post') : array
| since | 2.6.0 bbPress (r6737) |
|---|
array
string
string
arrayget_users_for_object(integer $object_id= 0, string $meta_key= '', string $meta_type= 'post') : array
The database queries in this function were cached in bbPress versions older than 2.6, but no longer are to avoid cache pollution.
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::get_users_for_object() |
integerThe object id.
stringThe key used to index this relationship.
stringThe type of meta to look in.
arrayReturns ids of users.get_users_for_object(integer $object_id= 0, string $meta_key= '', string $meta_type= 'post') : array
| since | 2.6.0 bbPress (r6722) |
|---|
integerThe object id.
stringThe key used to index this relationship.
stringThe type of meta to look in.
arrayReturns ids of users.remove_all_users_from_all_objects(string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::remove_all_users_from_all_objects() |
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_all_users_from_all_objects(string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6722) |
|---|
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_object_from_all_users(integer $object_id= 0, string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::remove_object_from_all_users() |
integerThe object id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_object_from_all_users(integer $object_id= 0, string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6722) |
|---|
integerThe object id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_user_from_all_objects(integer $user_id= 0, string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::remove_user_from_all_objects() |
integerThe user id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_user_from_all_objects(integer $user_id= 0, string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6722) |
|---|
integerThe user id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_user_from_object(integer $object_id= 0, integer $user_id= 0, string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::remove_user_from_object() |
integerThe object id.
integerThe user id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.remove_user_from_object(integer $object_id= 0, integer $user_id= 0, string $meta_key= '', string $meta_type= 'post') : boolean
| since | 2.6.0 bbPress (r6722) |
|---|
integerThe object id.
integerThe user id.
stringThe relationship key.
stringThe relationship type (usually 'post').
booleanReturns true on success, false on failure.cache_delete(string $meta_key= '', integer $object_id= 0) : mixed
This method exists to provide backwards compatibility with bbPress 2.5, which had caching surrounding the FIND_IN_SET queries in usermeta.
| since | 2.6.3 bbPress (r6991) |
|---|
string
integer
mixedResults from cache delete.cache_get(string $meta_key= '', integer $object_id= 0) : mixed
This method exists to provide backwards compatibility with bbPress 2.5, which had caching surrounding the FIND_IN_SET queries in usermeta.
| since | 2.6.3 bbPress (r6991) |
|---|
string
integer
mixedResults from cache get.cache_set(string $meta_key= '', integer $object_id= 0, $user_ids= array()) : mixed
This method exists to provide backwards compatibility with bbPress 2.5, which had caching surrounding the FIND_IN_SET queries in usermeta.
| since | 2.6.3 bbPress (r6991) |
|---|
string
integer
mixedResults from cache set.get_cache_key(string $meta_key= '', integer $object_id= 0) : string
This method exists to provide backwards compatibility with bbPress 2.5, which had caching surrounding the FIND_IN_SET usermeta queries.
| since | 2.6.3 bbPress (r6991) |
|---|
string
integer
stringget_user_option_key(string $meta_key= '', integer $object_id= 0, boolean $prefix= false) : string
| since | 2.6.0 bbPress (r6844) |
|---|
string
integer
boolean
stringparse_comma_list(string $results = '') : array
| since | 2.6.0 bbPress (r6844) |
|---|
string
array$type : string
'user'| since | 2.6.0 bbPress (r6844) |
|---|---|
| inherited_from | \BBP_User_Engagements_Base::type |
$type : string
''| since | 2.6.0 bbPress (r6737) |
|---|