Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/11/2015 11:12:52 PM (9 years ago)
Author:
tw2113
Message:

Initial documentation cleanup for the BP Blogs component.

See #6397.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-blogs/bp-blogs-functions.php

    r9979 r10011  
    2424
    2525/**
    26  * Retrieve a set of blogs
     26 * Retrieve a set of blogs.
    2727 *
    2828 * @see BP_Blogs_Blog::get() for a description of arguments and return value.
    2929 *
    30  * @param array $args {
     30 * @param array|string $args {
    3131 *     Arguments are listed here with their default values. For more
    3232 *     information about the arguments, see {@link BP_Blogs_Blog::get()}.
    33  *     @type string $type Default: 'active'.
    34  *     @type int|bool $user_id Default: false.
    35  *     @type array $include_blog_ids Default: false.
    36  *     @type string|bool $search_terms Default: false.
    37  *     @type int $per_page Default: 20.
    38  *     @type int $page Default: 1.
    39  *     @type bool $update_meta_cache Whether to pre-fetch blogmeta. Default: true.
     33 *     @type string      $type              Default: 'active'.
     34 *     @type int|bool    $user_id          Default: false.
     35 *     @type array       $include_blog_ids Default: false.
     36 *     @type string|bool $search_terms      Default: false.
     37 *     @type int         $per_page          Default: 20.
     38 *     @type int         $page              Default: 1.
     39 *     @type bool        $update_meta_cache Whether to pre-fetch blogmeta. Default: true.
    4040 * }
    4141 * @return array See {@link BP_Blogs_Blog::get()}.
     
    7474 * @since BuddyPress (1.0.0)
    7575 *
    76  * @global object $wpdb WordPress database object
     76 * @global object $wpdb WordPress database object.
    7777 * @uses get_users()
    7878 * @uses bp_blogs_record_blog()
     79 *
     80 * @return bool
    7981 */
    8082function bp_blogs_record_existing_blogs() {
     
    168170 * @param int $blog_id ID of the blog being checked.
    169171 * @param int $user_id Optional. ID of the user for whom access is being checked.
     172 *
    170173 * @return bool True if blog is recordable, otherwise false.
    171174 */
     
    200203 * @param int $blog_id ID of the blog being checked.
    201204 * @param int $user_id Optional. ID of the user for whom access is being checked.
     205 *
    202206 * @return bool True if blog is trackable, otherwise false.
    203207 */
     
    226230 * @uses BP_Blogs_Blog
    227231 *
    228  * @param int $blog_id ID of the blog being recorded.
    229  * @param int $user_id ID of the user for whom the blog is being recorded.
     232 * @param int  $blog_id    ID of the blog being recorded.
     233 * @param int  $user_id    ID of the user for whom the blog is being recorded.
    230234 * @param bool $no_activity Optional. Whether to skip recording an activity
    231  *        item about this blog creation. Default: false.
     235 *                          item about this blog creation. Default: false.
     236 *
    232237 * @return bool|null Returns false on failure.
    233238 */
     
    308313 *
    309314 * @param string $oldvalue Value before save. Passed by do_action() but
    310  *        unused here.
     315 *                         unused here.
    311316 * @param string $newvalue Value to change meta to.
    312317 */
     
    319324
    320325/**
    321  * Update blog description in BuddyPress blogmeta table
     326 * Update blog description in BuddyPress blogmeta table.
    322327 *
    323328 * @global object $wpdb DB Layer.
    324329 *
    325330 * @param string $oldvalue Value before save. Passed by do_action() but
    326  *        unused here.
     331 *                         unused here.
    327332 * @param string $newvalue Value to change meta to.
    328333 */
     
    342347 *
    343348 * @param string $oldvalue Value before save. Passed by do_action() but
    344  *        unused here.
     349 *                         unused here.
    345350 * @param string $newvalue Value to change meta to.
    346351 */
     
    360365 *
    361366 * @param string $oldvalue Value before save. Passed by do_action() but
    362  *        unused here.
     367 *                         unused here.
    363368 * @param string $newvalue Value to change meta to.
    364369 */
     
    378383 *
    379384 * @param string $oldvalue Value before save. Passed by do_action() but
    380  *        unused here.
     385 *                         unused here.
    381386 * @param string $newvalue Value to change meta to.
    382387 */
     
    402407 *
    403408 * @param string $oldvalue Value before save. Passed by do_action() but
    404  *        unused here.
     409 *                         unused here.
    405410 * @param string $newvalue Value to change meta to.
    406411 */
     
    424429 * @since BuddyPress (2.3.0)
    425430 *
    426  * @param int $site_id The site ID
     431 * @param int $site_id The site ID.
    427432 */
    428433function bp_blogs_delete_url_blogmeta( $site_id = 0 ) {
     
    436441 * @since BuddyPress (2.2.0)
    437442 *
    438  * @param  int     $activity_id ID of the activity item.
    439  * @param  WP_Post $post        Post object.
     443 * @param int     $activity_id ID of the activity item.
     444 * @param WP_Post $post        Post object.
     445 * @param array   $args        Array of arguments.
    440446 */
    441447function bp_blogs_publish_post_activity_meta( $activity_id, $post, $args ) {
     
    556562 * Only posts the item if blog is public and post is not password-protected.
    557563 *
    558  * @param int $comment_id ID of the comment being recorded.
     564 * @param int         $comment_id ID of the comment being recorded.
    559565 * @param bool|string $is_approved Optional. The $is_approved value passed to
    560  *        the 'comment_post' action. Default: true.
     566 *                                 the 'comment_post' action. Default: true.
     567 *
    561568 * @return bool|object Returns false on failure, the comment object on success.
    562569 */
     
    737744 * modify this behavior.
    738745 *
    739  * @param int         $user_id The ID of the user
    740  * @param string|bool $role    User's WordPress role for this blog ID
    741  * @param int         $blog_id Blog ID user is being added to
     746 * @param int         $user_id The ID of the user.
     747 * @param string|bool $role    User's WordPress role for this blog ID.
     748 * @param int         $blog_id Blog ID user is being added to.
    742749 *
    743750 * @return bool|null False on failure.
     
    822829
    823830/**
    824  * Rehook WP's maybe_add_existing_user_to_blog with a later priority
     831 * Rehook WP's maybe_add_existing_user_to_blog with a later priority.
    825832 *
    826833 * WordPress catches add-user-to-blog requests at init:10. In some cases, this
     
    929936 * @param int $blog_id Optional. Defaults to current blog ID.
    930937 * @param int $user_id Optional. Defaults to the logged-in user ID. This param
    931  *        is currently unused in the function (but is passed to hooks).
     938 *                     is currently unused in the function (but is passed to hooks).
     939 *
     940 * @return bool
    932941 */
    933942function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) {
     
    10541063 *
    10551064 * @param array $activity_ids The activity IDs to check association with blog
    1056  *              comments.
    1057  * @param bool $force_delete Whether to force delete the comments. If false,
    1058  *             comments are trashed instead.
     1065 *                            comments.
     1066 * @param bool $force_delete  Whether to force delete the comments. If false,
     1067 *                            comments are trashed instead.
    10591068 */
    10601069function bp_blogs_remove_associated_blog_comments( $activity_ids = array(), $force_delete = true ) {
     
    10931102 * @param string $new_status New comment status.
    10941103 * @param string $old_status Previous comment status.
    1095  * @param object $comment Comment data.
     1104 * @param object $comment    Comment data.
    10961105 */
    10971106function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) {
     
    11901199 *
    11911200 * @param int $user_id ID of the user being queried. Default: on a user page,
    1192  *        the displayed user. Otherwise, the logged-in user.
     1201 *                     the displayed user. Otherwise, the logged-in user.
     1202 *
    11931203 * @return int $count Total blog count for the user.
    11941204 */
     
    12571267 *      and return values.
    12581268 *
    1259  * @param int $user_id See {@BP_Blogs_Blog::get_blogs_for_user()}.
     1269 * @param int  $user_id    See {@BP_Blogs_Blog::get_blogs_for_user()}.
    12601270 * @param bool $show_hidden See {@BP_Blogs_Blog::get_blogs_for_user()}.
     1271 *
    12611272 * @return array See {@BP_Blogs_Blog::get_blogs_for_user()}.
    12621273 */
     
    12711282 *
    12721283 * @param int $limit See {@BP_Blogs_Blog::get_all()}.
    1273  * @param int $page See {@BP_Blogs_Blog::get_all()}.
     1284 * @param int $page  See {@BP_Blogs_Blog::get_all()}.
     1285 *
    12741286 * @return array See {@BP_Blogs_Blog::get_all()}.
    12751287 */
     
    12841296 *
    12851297 * @param int $limit See {@BP_Blogs_Blog::get()}.
    1286  * @param int $page See {@BP_Blogs_Blog::get()}.
     1298 * @param int $page  See {@BP_Blogs_Blog::get()}.
     1299 *
    12871300 * @return array See {@BP_Blogs_Blog::get()}.
    12881301 */
     
    12971310 *
    12981311 * @param int $blog_id See {@BP_Blogs_Blog::is_hidden()}.
     1312 *
    12991313 * @return bool See {@BP_Blogs_Blog::is_hidden()}.
    13001314 */
     
    13171331 * @global object $wpdb WordPress database access object.
    13181332 *
    1319  * @param int $blog_id ID of the blog whose metadata is being deleted.
    1320  * @param string $meta_key Optional. The key of the metadata being deleted. If
    1321  *        omitted, all BP metadata associated with the blog will be deleted.
    1322  * @param string $meta_value Optional. If present, the metadata will only be
    1323  *        deleted if the meta_value matches this parameter.
    1324  * @param bool $delete_all Optional. If true, delete matching metadata entries
    1325  *    for all objects, ignoring the specified blog_id. Otherwise, only
    1326  *    delete matching metadata entries for the specified blog.
    1327  *    Default: false.
     1333 * @param int         $blog_id    ID of the blog whose metadata is being deleted.
     1334 * @param string|bool $meta_key   Optional. The key of the metadata being deleted. If
     1335 *                                omitted, all BP metadata associated with the blog will
     1336 *                                be deleted.
     1337 * @param string|bool $meta_value Optional. If present, the metadata will only be
     1338 *                                deleted if the meta_value matches this parameter.
     1339 * @param bool        $delete_all Optional. If true, delete matching metadata entries for
     1340 *                               all objects, ignoring the specified blog_id. Otherwise, only
     1341 *                               delete matching metadata entries for the specified blog.
     1342 *                               Default: false.
     1343 *
    13281344 * @return bool True on success, false on failure.
    13291345 */
     
    13581374 * @global object $wpdb WordPress database access object.
    13591375 *
    1360  * @param int $blog_id ID of the blog whose metadata is being requested.
     1376 * @param int    $blog_id ID of the blog whose metadata is being requested.
    13611377 * @param string $meta_key Optional. If present, only the metadata matching
    1362  *        that meta key will be returned. Otherwise, all metadata for the
    1363  *        blog will be fetched.
    1364  * @param bool $single Optional. If true, return only the first value of the
    1365  *    specified meta_key. This parameter has no effect if meta_key is not
    1366  *    specified. Default: true.
     1378 *                         that meta key will be returned. Otherwise, all
     1379 *                         metadata for the blog will be fetched.
     1380 * @param bool   $single   Optional. If true, return only the first value of the
     1381 *                          specified meta_key. This parameter has no effect if
     1382 *                          meta_key is not specified. Default: true.
     1383 *
    13671384 * @return mixed The meta value(s) being requested.
    13681385 */
     
    13801397 * @global object $wpdb WordPress database access object.
    13811398 *
    1382  * @param int $blog_id ID of the blog whose metadata is being updated.
    1383  * @param string $meta_key Key of the metadata being updated.
    1384  * @param mixed $meta_value Value to be set.
    1385  * @param mixed $prev_value Optional. If specified, only update existing
    1386  *        metadata entries with the specified value. Otherwise, update all
    1387  *        entries.
     1399 * @param int    $blog_id    ID of the blog whose metadata is being updated.
     1400 * @param string $meta_key   Key of the metadata being updated.
     1401 * @param mixed  $meta_value Value to be set.
     1402 * @param mixed  $prev_value Optional. If specified, only update existing
     1403 *                           metadata entries with the specified value.
     1404 *                           Otherwise, update all entries.
     1405 *
    13881406 * @return bool|int Returns false on failure. On successful update of existing
    1389  *         metadata, returns true. On successful creation of new metadata,
    1390  *         returns the integer ID of the new metadata row.
     1407 *                  metadata, returns true. On successful creation of new metadata,
     1408 *                  returns the integer ID of the new metadata row.
    13911409 */
    13921410function bp_blogs_update_blogmeta( $blog_id, $meta_key, $meta_value, $prev_value = '' ) {
     
    14031421 * @since BuddyPress (2.0.0)
    14041422 *
    1405  * @param int $blog_id ID of the blog.
    1406  * @param string $meta_key Metadata key.
    1407  * @param mixed $meta_value Metadata value.
    1408  * @param bool $unique Optional. Whether to enforce a single metadata value
    1409  *        for the given key. If true, and the object already has a value for
    1410  *        the key, no change will be made. Default: false.
     1423 * @param int    $blog_id    ID of the blog.
     1424 * @param string $meta_key   Metadata key.
     1425 * @param mixed  $meta_value Metadata value.
     1426 * @param bool   $unique     Optional. Whether to enforce a single metadata value
     1427 *                           for the given key. If true, and the object already has a value for
     1428 *                           the key, no change will be made. Default: false.
     1429 *
    14111430 * @return int|bool The meta ID on successful update, false on failure.
    14121431 */
     
    14221441 *
    14231442 * @param int $user_id ID whose blog data should be removed.
     1443 *
    14241444 * @return bool|null Returns false on failure.
    14251445 */
     
    14541474
    14551475/**
    1456  * Restore all blog associations for a given user
     1476 * Restore all blog associations for a given user.
    14571477 *
    14581478 * @since BuddyPress (2.2.0)
Note: See TracChangeset for help on using the changeset viewer.