BBP_User_Engagements_Base
Base strategy class for interfacing with User Engagements, which other classes will extend.
Description Description
Source Source
File: includes/common/engagements.php
class BBP_User_Engagements_Base {
/**
* Type of strategy being used.
*
* @since 2.6.0 bbPress (r6737)
*
* @var string
*/
public $type = '';
/**
* Add a user id to an object
*
* @since 2.6.0 bbPress (r6722)
*
* @param int $object_id The object id
* @param int $user_id The user id
* @param string $meta_key The relationship key
* @param string $meta_type The relationship type (usually 'post')
* @param bool $unique Whether meta key should be unique to the object
*
* @return bool Returns true on success, false on failure
*/
public function add_user_to_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post', $unique = false ) {
}
/**
* Remove a user id from an object
*
* @since 2.6.0 bbPress (r6722)
*
* @param int $object_id The object id
* @param int $user_id The user id
* @param string $meta_key The relationship key
* @param string $meta_type The relationship type (usually 'post')
*
* @return bool Returns true on success, false on failure
*/
public function remove_user_from_object( $object_id = 0, $user_id = 0, $meta_key = '', $meta_type = 'post' ) {
}
/**
* Remove a user id from all objects
*
* @since 2.6.0 bbPress (r6722)
*
* @param int $user_id The user id
* @param string $meta_key The relationship key
* @param string $meta_type The relationship type (usually 'post')
*
* @return bool Returns true on success, false on failure
*/
public function remove_user_from_all_objects( $user_id = 0, $meta_key = '', $meta_type = 'post' ) {
}
/**
* Remove an object from all users
*
* @since 2.6.0 bbPress (r6722)
*
* @param int $object_id The object id
* @param int $user_id The user id
* @param string $meta_key The relationship key
* @param string $meta_type The relationship type (usually 'post')
*
* @return bool Returns true on success, false on failure
*/
public function remove_object_from_all_users( $object_id = 0, $meta_key = '', $meta_type = 'post' ) {
}
/**
* Remove all users from all objects
*
* @since 2.6.0 bbPress (r6722)
*
* @param string $meta_key The relationship key
* @param string $meta_type The relationship type (usually 'post')
*
* @return bool Returns true on success, false on failure
*/
public function remove_all_users_from_all_objects( $meta_key = '', $meta_type = 'post' ) {
}
/**
* Get users of an object
*
* @since 2.6.0 bbPress (r6722)
*
* @param int $object_id The object id
* @param string $meta_key The key used to index this relationship
* @param string $meta_type The type of meta to look in
*
* @return array Returns ids of users
*/
public function get_users_for_object( $object_id = 0, $meta_key = '', $meta_type = 'post' ) {
}
/**
* Get the part of the query responsible for JOINing objects to relationships.
*
* @since 2.6.0 bbPress (r6737)
*
* @param array $args
* @param string $meta_key
* @param string $meta_type
*
* @return array
*/
public function get_query( $args = array(), $context_key = '', $meta_key = '', $meta_type = 'post' ) {
}
}
Changelog Changelog
| Version | Description |
|---|---|
| 2.6.0 | Introduced. |
Methods Methods
- add_user_to_object — Add a user id to an object
- get_query — Get the part of the query responsible for JOINing objects to relationships.
- get_users_for_object — Get users of an object
- remove_all_users_from_all_objects — Remove all users from all objects
- remove_object_from_all_users — Remove an object from all users
- remove_user_from_all_objects — Remove a user id from all objects
- remove_user_from_object — Remove a user id from an object