[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-blogs/classes/ -> class-bp-blogs-blog.php (summary)

BuddyPress Blogs Classes.

File Size: 665 lines (26 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Blogs_Blog:: (18 methods):
  __construct()
  populate()
  save()
  exists()
  get()
  delete_blog_for_all()
  delete_blog_for_user()
  delete_blogs_for_user()
  get_blogs_for_user()
  get_blog_ids_for_user()
  is_recorded()
  total_blog_count_for_user()
  search_blogs()
  get_all()
  get_by_letter()
  get_blog_extras()
  is_hidden()
  get_user_blog()


Class: BP_Blogs_Blog  - X-Ref

The main BuddyPress blog class.

A BP_Blogs_Object represents a link between a specific WordPress blog on a
network and a specific user on that blog.

__construct( $id = null )   X-Ref
Constructor method.

param: int|null $id Optional. The ID of the blog.

populate()   X-Ref
Populate the object with data about the specific activity item.


save()   X-Ref
Save the BP blog data to the database.

return: bool True on success, false on failure.

exists()   X-Ref
Check whether an association between this user and this blog exists.

return: int $value The number of associations between the user and blog

get( $type, $limit = false, $page = false, $user_id = 0, $search_terms = false, $update_meta_cache = true, $include_blog_ids = false )   X-Ref
Retrieve a set of blog-user associations.

return: array Multidimensional results array, structured as follows:
param: string      $type              The order in which results should be returned.
param: int|bool    $limit             Optional. The maximum records to return.
param: int|bool    $page              Optional. The page of records to return.
param: int         $user_id           Optional. ID of the user whose blogs are being
param: string|bool $search_terms      Optional. Search by text stored in
param: bool        $update_meta_cache Whether to pre-fetch metadata for
param: array|bool  $include_blog_ids  Array of blog IDs to include.

delete_blog_for_all( $blog_id )   X-Ref
Delete the record of a given blog for all users.

return: int|bool Number of rows deleted on success, false on failure.
param: int $blog_id The blog being removed from all users.

delete_blog_for_user( $blog_id, $user_id = null )   X-Ref
Delete the record of a given blog for a specific user.

return: int|bool Number of rows deleted on success, false on failure.
param: int      $blog_id The blog being removed.
param: int|null $user_id Optional. The ID of the user from whom the blog is

delete_blogs_for_user( $user_id = null )   X-Ref
Delete all of a user's blog associations in the BP tables.

return: int|bool Number of rows deleted on success, false on failure.
param: int|null $user_id Optional. The ID of the user whose blog associations

get_blogs_for_user( $user_id = 0, $show_hidden = false )   X-Ref
Get all of a user's blogs, as tracked by BuddyPress.

Note that this is different from the WordPress function
{@link get_blogs_of_user()}; the current method returns only those
blogs that have been recorded by BuddyPress, while the WP function
does a true query of a user's blog capabilities.

return: array Multidimensional results array, structured as follows:
param: int  $user_id     Optional. ID of the user whose blogs are being
param: bool $show_hidden Optional. Whether to include blogs that are not marked

get_blog_ids_for_user( $user_id = 0 )   X-Ref
Get IDs of all of a user's blogs, as tracked by BuddyPress.

This method always includes hidden blogs.

return: int The number of blogs associated with the user.
param: int $user_id Optional. ID of the user whose blogs are being

is_recorded( $blog_id )   X-Ref
Check whether a blog has been recorded by BuddyPress.

return: int|null The ID of the first located entry in the BP table
param: int $blog_id ID of the blog being queried.

total_blog_count_for_user( $user_id = null )   X-Ref
Return a count of associated blogs for a given user.

Includes hidden blogs when the logged-in user is the same as the
$user_id parameter, or when the logged-in user has the bp_moderate
cap.

return: int Blog count for the user.
param: int|null $user_id Optional. ID of the user whose blogs are being

search_blogs( $filter, $limit = null, $page = null )   X-Ref
Return a list of blogs matching a search term.

Matches against blog names and descriptions, as stored in the BP
blogmeta table.

return: array Multidimensional results array, structured as follows:
param: string   $filter The search term.
param: int|null $limit  Optional. The maximum number of items to return.
param: int|null $page   Optional. The page of results to return. Default:

get_all( $limit = null, $page = null )   X-Ref
Retrieve a list of all blogs.

Query will include hidden blogs if the logged-in user has the
'bp_moderate' cap.

return: array Multidimensional results array, structured as follows:
param: int|null $limit Optional. The maximum number of items to return.
param: int|null $page  Optional. The page of results to return. Default:

get_by_letter( $letter, $limit = null, $page = null )   X-Ref
Retrieve a list of blogs whose names start with a given letter.

Query will include hidden blogs if the logged-in user has the
'bp_moderate' cap.

return: array Multidimensional results array, structured as follows:
param: string   $letter The letter you're looking for.
param: int|null $limit  Optional. The maximum number of items to return.
param: int|null $page   Optional. The page of results to return. Default:

get_blog_extras( &$paged_blogs, &$blog_ids, $type = false )   X-Ref
Fetch blog data not caught in the main query and append it to results array.

Gets the following information, which is either unavailable at the
time of the original query, or is more efficient to look up in one
fell swoop:
- The latest post for each blog, include Featured Image data
- The blog description

return: array $paged_blogs The located blogs array, with the extras added.
param: array       $paged_blogs Array of results from the original query.
param: array       $blog_ids    Array of IDs returned from the original query.
param: string|bool $type        Not currently used. Default: false.

is_hidden( $blog_id )   X-Ref
Check whether a given blog is hidden.

Checks the 'public' column in the wp_blogs table.

return: bool True if hidden (public = 0), false otherwise.
param: int $blog_id The ID of the blog being checked.

get_user_blog( $user_id, $blog_id )   X-Ref
Get ID of user-blog link.

return: int|bool ID of user-blog link, or false if not found.
param: int $user_id ID of user.
param: int $blog_id ID of blog.



Generated: Thu Nov 14 01:01:40 2019 Cross-referenced by PHPXref 0.7.1