[ 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.

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.
return: array Multidimensional results array, structured as follows:

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

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

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

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

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

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

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.

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
return: array Multidimensional results array, structured as follows:

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.

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

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

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

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.

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

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.

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:
return: array Multidimensional results array, structured as follows:

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.

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

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.

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:
return: array Multidimensional results array, structured as follows:

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

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.
return: array $paged_blogs The located blogs array, with the extras added.

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

Checks the 'public' column in the wp_blogs table.

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

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

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



Generated: Mon Jul 15 01:01:40 2019 Cross-referenced by PHPXref 0.7.1