Skip to:
Content

BuddyPress.org

Changeset 10011


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

Initial documentation cleanup for the BP Blogs component.

See #6397.

Location:
trunk/src/bp-blogs
Files:
9 edited

Legend:

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

    r9958 r10011  
    6565 * @since BuddyPress (2.0.0)
    6666 *
    67  * @param string $action Static activity action.
    68  * @param obj $activity Activity data object.
     67 * @param string $action   Static activity action.
     68 * @param object $activity Activity data object.
     69 *
     70 * @return string
    6971 */
    7072function bp_blogs_format_activity_action_new_blog( $action, $activity ) {
     
    9294         *
    9395         * @param string $action   Constructed activity action.
    94          * @param obj    $activity Activity data object.
     96         * @param object $activity Activity data object.
    9597         */
    9698        return apply_filters( 'bp_blogs_format_activity_action_new_blog', $action, $activity );
     
    102104 * @since BuddyPress (2.0.0)
    103105 *
    104  * @param string $action Static activity action.
    105  * @param obj $activity Activity data object.
     106 * @param string $action   Static activity action.
     107 * @param object $activity Activity data object.
     108 *
     109 * @return string Constructed activity action.
    106110 */
    107111function bp_blogs_format_activity_action_new_blog_post( $action, $activity ) {
     
    202206         *
    203207         * @param string $action   Constructed activity action.
    204          * @param obj    $activity Activity data object.
     208         * @param object $activity Activity data object.
    205209         */
    206210        return apply_filters( 'bp_blogs_format_activity_action_new_blog_post', $action, $activity );
     
    212216 * @since BuddyPress (2.0.0)
    213217 *
    214  * @param string $action Static activity action.
    215  * @param obj $activity Activity data object.
     218 * @param string $action   Static activity action.
     219 * @param object $activity Activity data object.
     220 *
     221 * @return string Constructed activity action.
    216222 */
    217223function bp_blogs_format_activity_action_new_blog_comment( $action, $activity ) {
     
    277283         *
    278284         * @param string $action   Constructed activity action.
    279          * @param obj    $activity Activity data object.
     285         * @param object $activity Activity data object.
    280286         */
    281287        return apply_filters( 'bp_blogs_format_activity_action_new_blog_comment', $action, $activity );
     
    290296 *
    291297 * @param array $activities Array of activity items.
     298 *
    292299 * @return array
    293300 */
     
    322329 * @see bp_activity_add() for description of parameters.
    323330 *
    324  * @param array $args {
     331 * @param array|string $args {
    325332 *     See {@link bp_activity_add()} for complete description of arguments.
    326333 *     The arguments listed here have different default values from
     
    399406 * @see bp_activity_delete() for description of parameters.
    400407 *
    401  * @param array $args {
     408 * @param array|string $args {
    402409 *     See {@link bp_activity_delete()} for complete description of arguments.
    403410 *     The arguments listed here have different default values from
     
    439446 *
    440447 * @param object $activity The BP_Activity_Activity object
     448 *
    441449 * @return bool
    442450 */
     
    523531 * @since BuddyPress (2.0.0)
    524532 *
    525  * @param int $comment_id The activity ID for the posted activity comment.
    526  * @param array $params Parameters for the activity comment.
    527  * @param object Parameters of the parent activity item (in this case, the blog post).
     533 * @param int    $comment_id      The activity ID for the posted activity comment.
     534 * @param array  $params          Parameters for the activity comment.
     535 * @param object $parent_activity Parameters of the parent activity item (in this case, the blog post).
    528536 */
    529537function bp_blogs_sync_add_from_activity_comment( $comment_id, $params, $parent_activity ) {
     
    630638 *
    631639 * @param bool $retval
    632  * @param int $parent_activity_id The parent activity ID for the activity comment.
    633  * @param int $activity_id The activity ID for the pending deleted activity comment.
     640 * @param int  $parent_activity_id The parent activity ID for the activity comment.
     641 * @param int  $activity_id        The activity ID for the pending deleted activity comment.
     642 *
     643 * @return bool
    634644 */
    635645function bp_blogs_sync_delete_from_activity_comment( $retval, $parent_activity_id, $activity_id ) {
     
    732742 * @since BuddyPress (2.0.0)
    733743 *
    734  * @param int $post_id The post ID
     744 * @param int   $post_id  The post ID.
    735745 * @param array $comments Array of comment statuses. The key is comment ID, the
    736  *        value is the $comment->comment_approved value.
     746 *                        value is the $comment->comment_approved value.
    737747 */
    738748function bp_blogs_remove_activity_meta_for_trashed_comments( $post_id = 0, $comments = array() ) {
     
    764774 *
    765775 * @param array $args Arguments passed from bp_parse_args() in bp_has_activities().
     776 *
    766777 * @return array $args
    767778 */
     
    837848 * @see bp_blogs_setup_comment_loop_globals_on_ajax()
    838849 *
    839  * @param object $activity The BP_Activity_Activity object
     850 * @param object $activity The BP_Activity_Activity object.
    840851 */
    841852function bp_blogs_setup_activity_loop_globals( $activity ) {
     
    919930 *
    920931 * @param bool $retval Is activity commenting enabled for this activity entry?
     932 *
    921933 * @return bool
    922934 */
     
    969981 * @since BuddyPress (2.0.0)
    970982 *
    971  * @param bool $retval Are replies allowed for this activity reply?
    972  * @param object $comment The activity comment object
     983 * @param bool   $retval  Are replies allowed for this activity reply?
     984 * @param object $comment The activity comment object.
     985 *
    973986 * @return bool
    974987 */
     
    10071020 * @since BuddyPress (2.0.0)
    10081021 *
    1009  * @param string $retval The activity comment permalink
     1022 * @param string $retval The activity comment permalink.
     1023 *
    10101024 * @return string
    10111025 */
     
    10341048 * @since BuddyPress (2.0.1)
    10351049 *
    1036  * @param string $retval The activity permalink
     1050 * @param string               $retval   The activity permalink.
    10371051 * @param BP_Activity_Activity $activity
     1052 *
    10381053 * @return string
    10391054 */
     
    10601075 * @since BuddyPress (2.0.1)
    10611076 *
    1062  * @param string $retval The activity action
     1077 * @param string               $retval   The activity action.
    10631078 * @param BP_Activity_Activity $activity
     1079 *
    10641080 * @return string
    10651081 */
  • trunk/src/bp-blogs/bp-blogs-cache.php

    r9819 r10011  
    2121 * using querying blogmeta inline.
    2222 *
    23  * @param int|str|array $blog_ids Accepts a single blog ID, or a comma-
    24  *        separated list or array of blog IDs.
     23 * @param int|string|array|bool $blog_ids Accepts a single blog ID, or a comma-
     24 *                                        separated list or array of blog IDs.
    2525 */
    2626function bp_blogs_update_meta_cache( $blog_ids = false ) {
  • trunk/src/bp-blogs/bp-blogs-filters.php

    r9819 r10011  
    3131 *
    3232 * @param string $url The original URL (points to wp-signup.php by default).
     33 *
    3334 * @return string The new URL.
    3435 */
     
    5354 * @see bp_blogs_update_post_activity_meta()
    5455 *
    55  * @param array Current SQL clauses in array format
     56 * @param array $retval Current SQL clauses in array format.
     57 *
    5658 * @return array
    5759 */
     
    7375 * @param  int  $post_id ID of the post.
    7476 * @param  int  $user_id ID of the post author.
     77 *
    7578 * @return bool True to authorize the post to be published, otherwise false.
    7679 */
  • 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)
  • trunk/src/bp-blogs/bp-blogs-loader.php

    r9936 r10011  
    139139         *
    140140         * @param array $main_nav Optional. See BP_Component::setup_nav() for
    141          *        description.
    142          * @param array $sub_nav Optional. See BP_Component::setup_nav() for
    143          *        description.
     141         *                        description.
     142         * @param array $sub_nav  Optional. See BP_Component::setup_nav() for
     143         *                        description.
    144144         */
    145145        public function setup_nav( $main_nav = array(), $sub_nav = array() ) {
     
    200200         *
    201201         * @param array $wp_admin_nav See BP_Component::setup_admin_bar()
    202          *        for description.
     202         *                            for description.
     203         *
     204         * @return bool
    203205         */
    204206        public function setup_admin_bar( $wp_admin_nav = array() ) {
     
    299301         *
    300302         * @see bp_activity_get_post_type_tracking_args() for information on parameters.
     303         *
     304         * @param object|null $params
     305         * @param string|int  $post_type
     306         *
     307         * @return object
    301308         */
    302309        public function post_tracking_args( $params = null, $post_type = 0 ) {
  • trunk/src/bp-blogs/bp-blogs-screens.php

    r9819 r10011  
    22
    33/**
    4  * BuddyPress Blogs Screens
     4 * BuddyPress Blogs Screens.
    55 *
    66 * @package BuddyPress
     
    7272
    7373/**
    74  * The main theme compat class for BuddyPress Blogs
     74 * The main theme compat class for BuddyPress Blogs.
    7575 *
    7676 * This class sets up the necessary theme compatibility actions to safely output
     
    139139         * @since BuddyPress (1.8.0)
    140140         *
    141          * @param string $templates The templates from
    142          *        bp_get_theme_compat_templates().
     141         * @param string $templates The templates from bp_get_theme_compat_templates().
     142         *
    143143         * @return array $templates Array of custom templates to look for.
    144144         */
     
    202202         * @since BuddyPress (1.8.0)
    203203         *
    204          * @param string $templates The templates from
    205          *        bp_get_theme_compat_templates().
     204         * @param string $templates The templates from bp_get_theme_compat_templates().
     205         *
    206206         * @return array $templates Array of custom templates to look for.
    207207         */
  • trunk/src/bp-blogs/bp-blogs-template.php

    r9960 r10011  
    8888         * @uses bp_get_root_domain()
    8989         * @uses bp_get_blogs_root_slug()
     90         *
    9091         * @return string The URL of the Blogs directory.
    9192         */
     
    153154         *
    154155         * @access public
    155          * @var public
     156         * @var int
    156157         */
    157158        public $pag_page = 1;
     
    161162         *
    162163         * @access public
    163          * @var public
     164         * @var int
    164165         */
    165166        public $pag_num = 20;
     
    186187         * @see BP_Blogs_Blog::get() for a description of parameters.
    187188         *
    188          * @param string $type See {@link BP_Blogs_Blog::get()}.
    189          * @param string $page See {@link BP_Blogs_Blog::get()}.
    190          * @param string $per_page See {@link BP_Blogs_Blog::get()}.
    191          * @param string $max See {@link BP_Blogs_Blog::get()}.
    192          * @param string $user_id See {@link BP_Blogs_Blog::get()}.
    193          * @param string $search_terms See {@link BP_Blogs_Blog::get()}.
    194          * @param string $page_arg The string used as a query parameter in
    195          *        pagination links. Default: 'bpage'.
    196          * @param bool $update_meta_cache Whether to pre-fetch metadata for
    197          *        queried blogs.
    198          * @param array $include_blog_ids Array of blog IDs to include.
     189         * @param string     $type              See {@link BP_Blogs_Blog::get()}.
     190         * @param string     $page              See {@link BP_Blogs_Blog::get()}.
     191         * @param string     $per_page          See {@link BP_Blogs_Blog::get()}.
     192         * @param string     $max              See {@link BP_Blogs_Blog::get()}.
     193         * @param string     $user_id          See {@link BP_Blogs_Blog::get()}.
     194         * @param string     $search_terms      See {@link BP_Blogs_Blog::get()}.
     195         * @param string     $page_arg          The string used as a query parameter in
     196         *                                      pagination links. Default: 'bpage'.
     197         * @param bool       $update_meta_cache Whether to pre-fetch metadata for
     198         *                                      queried blogs.
     199         * @param array|bool $include_blog_ids Array of blog IDs to include.
    199200         */
    200201        public function __construct( $type, $page, $per_page, $max, $user_id, $search_terms, $page_arg = 'bpage', $update_meta_cache = true, $include_blog_ids = false ) {
     
    364365 * @global object $blogs_template {@link BP_Blogs_Template}
    365366 *
    366  * @param array $args {
     367 * @param array|string $args {
    367368 *     Arguments for limiting the contents of the blogs loop. Most arguments
    368369 *     are in the same format as {@link BP_Blogs_Blog::get()}. However, because
     
    374375 *     string (eg, 'user_id=4&per_page=3').
    375376 *
    376  *     @type int $page Which page of results to fetch. Using page=1 without
    377  *           per_page will result in no pagination. Default: 1.
    378  *     @type int|bool $per_page Number of results per page. Default: 20.
    379  *     @type string $page_arg The string used as a query parameter in
    380  *           pagination links. Default: 'bpage'.
    381  *     @type int|bool $max Maximum number of results to return.
    382  *           Default: false (unlimited).
    383  *     @type string $type The order in which results should be fetched.
    384  *           'active', 'alphabetical', 'newest', or 'random'.
    385  *     @type array $include_blog_ids Array of blog IDs to limit results to.
    386  *     @type string $sort 'ASC' or 'DESC'. Default: 'DESC'.
    387  *     @type string $search_terms Limit results by a search term. Default: the
    388  *           value of $_REQUEST['s'], if present.
    389  *     @type int $user_id The ID of the user whose blogs should be retrieved.
    390  *           When viewing a user profile page, 'user_id' defaults to the ID of
    391  *           the displayed user. Otherwise the default is false.
     377 *     @type int      $page            Which page of results to fetch. Using page=1 without
     378 *                                      per_page will result in no pagination. Default: 1.
     379 *     @type int|bool $per_page         Number of results per page. Default: 20.
     380 *     @type string   $page_arg        The string used as a query parameter in
     381 *                                      pagination links. Default: 'bpage'.
     382 *     @type int|bool $max              Maximum number of results to return.
     383 *                                      Default: false (unlimited).
     384 *     @type string   $type            The order in which results should be fetched.
     385 *                                      'active', 'alphabetical', 'newest', or 'random'.
     386 *     @type array    $include_blog_ids Array of blog IDs to limit results to.
     387 *     @type string   $sort            'ASC' or 'DESC'. Default: 'DESC'.
     388 *     @type string   $search_terms    Limit results by a search term. Default: the
     389 *                                      value of $_REQUEST['s'], if present.
     390 *     @type int      $user_id          The ID of the user whose blogs should be retrieved.
     391 *                                      When viewing a user profile page, 'user_id' defaults to the
     392 *                                      ID of the displayed user. Otherwise the default is false.
    392393 * }
    393394 * @return bool Returns true when blogs are found, otherwise false.
     
    513514 * @see bp_get_blog_avatar() for description of arguments.
    514515 *
    515  * @param array $args See {@link bp_get_blog_avatar()}.
     516 * @param array|string $args See {@link bp_get_blog_avatar()}.
    516517 */
    517518function bp_blog_avatar( $args = '' ) {
     
    529530         *      return values.
    530531         *
    531          * @param array $args  {
     532         * @param array|string $args  {
    532533         *     Arguments are listed here with an explanation of their defaults.
    533534         *     For more information about the arguments, see
     
    774775         * @param array $args {
    775776         *     Array of optional arguments.
    776          *     @type bool $active_format If true, formatted "Active 5 minutes
    777          *           ago". If false, formatted "5 minutes ago". Default: true.
     777         *     @type bool $active_format If true, formatted "Active 5 minutes ago".
     778         *                               If false, formatted "5 minutes ago".
     779         *                               Default: true.
    778780         * }
    779781         * @return string Last active date.
     
    829831         * @param array $args {
    830832         *     Array of optional arguments.
    831          *     @type bool $latest_format If true, formatted "Latest post:
    832          *           [link to post]". If false, formatted "[link to post]".
    833          *           Default: true.
     833         *     @type bool $latest_format If true, formatted "Latest post: [link to post]".
     834         *                               If false, formatted "[link to post]".
     835         *                               Default: true.
    834836         * }
    835837         * @return string $retval String of the form 'Latest Post: [link to post]'.
     
    10031005         *
    10041006         * @param string $size Image version to return. 'thumbnail', 'medium',
    1005          *        'large', or 'post-thumbnail'. Default: 'thumbnail'.
     1007         *                     'large', or 'post-thumbnail'. Default: 'thumbnail'.
     1008         *
    10061009         * @return string URL of the image.
    10071010         */
     
    10291032 * @since BuddyPress (1.7.0)
    10301033 *
    1031  * @param string $size Image version to return. 'thumbnail', 'medium', 'large',
    1032  *        or 'post-thumbnail'. Default: 'thumbnail'.
     1034 * @param string $thumbnail Image version to return. 'thumbnail', 'medium', 'large',
     1035 *                          or 'post-thumbnail'. Default: 'thumbnail'.
     1036 *
    10331037 * @return bool True if the latest blog post from the current blog has a
    1034  *         featured image of the given size.
     1038 *              featured image of the given size.
    10351039 */
    10361040function bp_blog_latest_post_has_featured_image( $thumbnail = 'thumbnail' ) {
     
    11031107         *
    11041108         * @param int $user_id ID of the user.
     1109         *
    11051110         * @return int Total number of blogs for the user.
    11061111         */
     
    11541159 * Output the wrapper markup for the blog signup form.
    11551160 *
    1156  * @param string $blogname Optional. The default blog name (path or domain).
    1157  * @param string $blog_title Optional. The default blog title.
    1158  * @param string|WP_Error Optional. The WP_Error object returned by a previous
    1159  *        submission attempt.
     1161 * @param string          $blogname  Optional. The default blog name (path or domain).
     1162 * @param string          $blog_title Optional. The default blog title.
     1163 * @param string|WP_Error $errors     Optional. The WP_Error object returned by a previous
     1164 *                                    submission attempt.
    11601165 */
    11611166function bp_show_blog_signup_form($blogname = '', $blog_title = '', $errors = '') {
     
    12191224 * Output the input fields for the blog creation form.
    12201225 *
    1221  * @param string $blogname Optional. The default blog name (path or domain).
    1222  * @param string $blog_title Optional. The default blog title.
    1223  * @param string|WP_Error Optional. The WP_Error object returned by a previous
    1224  *        submission attempt.
     1226 * @param string          $blogname  Optional. The default blog name (path or domain).
     1227 * @param string          $blog_title Optional. The default blog title.
     1228 * @param string|WP_Error $errors     Optional. The WP_Error object returned by a previous
     1229 *                                    submission attempt.
    12251230 */
    12261231function bp_blogs_signup_blog( $blogname = '', $blog_title = '', $errors = '' ) {
     
    13321337         *
    13331338         * @param array $meta {
    1334          *      string   $value   Default blog language ID.
    1335          *      string   $public Default public status.
     1339         *      string $value  Default blog language ID.
     1340         *      string $public Default public status.
    13361341         * }
    13371342         */
     
    13651370 * Display a message after successful blog registration.
    13661371 *
    1367  * @param string $domain The new blog's domain.
    1368  * @param string $path The new blog's path.
    1369  * @param string $blog_title The new blog's title.
    1370  * @param string $user_name The user name of the user who created the blog. Unused.
    1371  * @param string $user_email The email of the user who created the blog. Unused.
    1372  * @param string|array $meta Meta values associated with the new blog. Unused.
     1372 * @param string       $domain    The new blog's domain.
     1373 * @param string       $path      The new blog's path.
     1374 * @param string       $blog_title The new blog's title.
     1375 * @param string       $user_name The user name of the user who created the blog. Unused.
     1376 * @param string       $user_email The email of the user who created the blog. Unused.
     1377 * @param string|array $meta       Meta values associated with the new blog. Unused.
    13731378 */
    13741379function bp_blogs_confirm_blog_signup( $domain, $path, $blog_title, $user_name, $user_email = '', $meta = '' ) {
     
    15451550 * @since BuddyPress (2.2.0)
    15461551 *
    1547  * @uses   bp_blog_create_nav_item() to output the Create a Site nav item
     1552 * @uses bp_blog_create_nav_item() to output the Create a Site nav item.
     1553 *
    15481554 * @return string HTML Output
    15491555 */
     
    15681574 * @see bp_get_blogs_visit_blog_button() for description of arguments.
    15691575 *
    1570  * @param array $args See {@link bp_get_blogs_visit_blog_button()}.
     1576 * @param array|string $args See {@link bp_get_blogs_visit_blog_button()}.
    15711577 */
    15721578function bp_blogs_visit_blog_button( $args = '' ) {
     
    15791585         *      value.
    15801586         *
    1581          * @param array $args {
     1587         * @param array|string $args {
    15821588         *     Arguments are listed below, with their default values. For a
    15831589         *     complete description of arguments, see {@link BP_Button}.
    1584          *     @type string $id Default: 'visit_blog'.
    1585          *     @type string $component Default: 'blogs'.
    1586          *     @type bool $must_be_logged_in Default: false.
    1587          *     @type bool $block_self Default: false.
    1588          *     @type string $wrapper_class Default: 'blog-button visit'.
    1589          *     @type string $link_href Permalink of the current blog in the loop.
    1590          *     @type string $link_class Default: 'blog-button visit'.
    1591          *     @type string $link_text Default: 'Visit Site'.
    1592          *     @type string $link_title Default: 'Visit Site'.
     1590         *     @type string $id                Default: 'visit_blog'.
     1591         *     @type string $component         Default: 'blogs'.
     1592         *     @type bool   $must_be_logged_in Default: false.
     1593         *     @type bool   $block_self        Default: false.
     1594         *     @type string $wrapper_class     Default: 'blog-button visit'.
     1595         *     @type string $link_href         Permalink of the current blog in the loop.
     1596         *     @type string $link_class        Default: 'blog-button visit'.
     1597         *     @type string $link_text         Default: 'Visit Site'.
     1598         *     @type string $link_title        Default: 'Visit Site'.
    15931599         * }
    15941600         * @return string The HTML for the Visit button.
     
    16261632 * @since BuddyPress (2.0.0)
    16271633 *
    1628  * @param array $args before|after|user_id
    1629  * @uses bp_blogs_admin_get_profile_stats() to get the stats
     1634 * @uses bp_blogs_admin_get_profile_stats() to get the stats.
     1635 *
     1636 * @param array|string $args before|after|user_id
    16301637 */
    16311638function bp_blogs_profile_stats( $args = '' ) {
     
    16391646 * @since BuddyPress (2.0.0)
    16401647 *
    1641  * @param array $args before|after|user_id
     1648 * @param array|string $args before|after|user_id
     1649 *
    16421650 * @return string HTML for stats output.
    16431651 */
  • trunk/src/bp-blogs/bp-blogs-widgets.php

    r9819 r10011  
    22
    33/**
    4  * BuddyPress Blogs Widgets
     4 * BuddyPress Blogs Widgets.
    55 *
    66 * @package BuddyPress
     
    2424
    2525/**
    26  * The Recent Networkwide Posts widget
     26 * The Recent Networkwide Posts widget.
    2727 */
    2828class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
     
    4444         * @see WP_Widget::widget() for description of parameters.
    4545         *
    46          * @param array $args Widget arguments.
     46         * @param array $args     Widget arguments.
    4747         * @param array $instance Widget settings, as saved by the user.
    4848         */
     
    127127         * @param array $new_instance The new instance options.
    128128         * @param array $old_instance The old instance options.
     129         *
    129130         * @return array $instance The parsed options to be saved.
    130131         */
     
    141142         * Output the networkwide posts widget options form.
    142143         *
    143          * @param $instance Settings for this widget.
     144         * @param array $instance Settings for this widget.
     145         *
     146         * @return string
    144147         */
    145148        public function form( $instance ) {
  • trunk/src/bp-blogs/classes/class-bp-blogs-blog.php

    r9819 r10011  
    6767                 * @since BuddyPress (1.0.0)
    6868                 *
    69                  * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference.
     69                 * @param BP_Blogs_Blog $this Current instance of the blog item being saved. Passed by reference.
    7070                 */
    7171                do_action_ref_array( 'bp_blogs_blog_before_save', array( &$this ) );
     
    9999                 * @since BuddyPress (1.0.0)
    100100                 *
    101                  * @param BP_Blogs_Blog Current instance of the blog item being saved. Passed by reference.
     101                 * @param BP_Blogs_Blog $this Current instance of the blog item being saved. Passed by reference.
    102102                 */
    103103                do_action_ref_array( 'bp_blogs_blog_after_save', array( &$this ) );
     
    112112         * Check whether an association between this user and this blog exists.
    113113         *
    114          * @return int The number of associations between the user and blog
    115          *         saved in the blog component tables.
     114         * @return int $value The number of associations between the user and blog
     115         *                    saved in the blog component tables.
    116116         */
    117117        public function exists() {
     
    128128         * Retrieve a set of blog-user associations.
    129129         *
    130          * @param string $type The order in which results should be returned.
    131          *        'active', 'alphabetical', 'newest', or 'random'.
    132          * @param int|bool $limit Optional. The maximum records to return.
    133          *        Default: false.
    134          * @param int|bool $page Optional. The page of records to return.
    135          *        Default: false (unlimited results).
    136          * @param int $user_id Optional. ID of the user whose blogs are being
    137          *        retrieved. Default: 0.
    138          * @param string|bool $search_terms Optional. Search by text stored in
    139          *        blogmeta (such as the blog name). Default: false.
    140          * @param bool $update_meta_cache Whether to pre-fetch metadata for
    141          *        blogs. Default: true.
    142          * @param array $include_blog_ids Array of blog IDs to include.
     130         * @param string      $type              The order in which results should be returned.
     131         *                                       'active', 'alphabetical', 'newest', or 'random'.
     132         * @param int|bool    $limit             Optional. The maximum records to return.
     133         *                                       Default: false.
     134         * @param int|bool    $page              Optional. The page of records to return.
     135         *                                       Default: false (unlimited results).
     136         * @param int         $user_id           Optional. ID of the user whose blogs are being
     137         *                                       retrieved. Default: 0.
     138         * @param string|bool $search_terms      Optional. Search by text stored in
     139         *                                       blogmeta (such as the blog name). Default: false.
     140         * @param bool        $update_meta_cache Whether to pre-fetch metadata for
     141         *                                       blogs. Default: true.
     142         * @param array|bool  $include_blog_ids  Array of blog IDs to include.
     143         *
    143144         * @return array Multidimensional results array, structured as follows:
    144          *           'blogs' - Array of located blog objects
    145          *           'total' - A count of the total blogs matching the filter params
     145         *               'blogs' - Array of located blog objects
     146         *               'total' - A count of the total blogs matching the filter params
    146147         */
    147148        public static function get( $type, $limit = false, $page = false, $user_id = 0, $search_terms = false, $update_meta_cache = true, $include_blog_ids = false ) {
     
    252253         *
    253254         * @param int $blog_id The blog being removed.
    254          * @param int $user_id Optional. The ID of the user from whom the blog
    255          *        is being removed. If absent, defaults to the logged-in user ID.
     255         * @param int $user_id Optional. The ID of the user from whom the blog is
     256         *                     being removed. If absent, defaults to the logged-in user ID.
     257         *
    256258         * @return int|bool Number of rows deleted on success, false on failure.
    257259         */
     
    270272         * Delete all of a user's blog associations in the BP tables.
    271273         *
    272          * @param int $user_id Optional. The ID of the user whose blog
    273          *        associations are being deleted. If absent, defaults to
    274          *        logged-in user ID.
     274         * @param int $user_id Optional. The ID of the user whose blog associations
     275         *                     are being deleted. If absent, defaults to logged-in user ID.
     276         *
    275277         * @return int|bool Number of rows deleted on success, false on failure.
    276278         */
     
    294296         * does a true query of a user's blog capabilities.
    295297         *
    296          * @param int $user_id Optional. ID of the user whose blogs are being
    297          *        queried. Defaults to logged-in user.
    298          * @param bool $show_hidden Optional. Whether to include blogs that are
    299          *        not marked public. Defaults to true when viewing one's own
    300          *        profile.
     298         * @param int  $user_id    Optional. ID of the user whose blogs are being
     299         *                          queried. Defaults to logged-in user.
     300         * @param bool $show_hidden Optional. Whether to include blogs that are not marked
     301         *                          public. Defaults to true when viewing one's own profile.
     302         *
    301303         * @return array Multidimensional results array, structured as follows:
    302          *           'blogs' - Array of located blog objects
    303          *           'total' - A count of the total blogs for the user.
     304         *               'blogs' - Array of located blog objects.
     305         *               'total' - A count of the total blogs for the user.
    304306         */
    305307        public static function get_blogs_for_user( $user_id = 0, $show_hidden = false ) {
     
    337339         *
    338340         * @param int $user_id Optional. ID of the user whose blogs are being
    339          *        queried. Defaults to logged-in user.
     341         *                     queried. Defaults to logged-in user.
     342         *
    340343         * @return int The number of blogs associated with the user.
    341344         */
     
    355358         *
    356359         * @param int $blog_id ID of the blog being queried.
     360         *
    357361         * @return int|null The ID of the first located entry in the BP table
    358          *         on success, otherwise null.
     362         *                  on success, otherwise null.
    359363         */
    360364        public static function is_recorded( $blog_id ) {
     
    374378         *
    375379         * @param int $user_id Optional. ID of the user whose blogs are being
    376          *        queried. Defaults to logged-in user.
     380         *                     queried. Defaults to logged-in user.
     381         *
    377382         * @return int Blog count for the user.
    378383         */
     
    400405         *
    401406         * @param string $filter The search term.
    402          * @param int $limit Optional. The maximum number of items to return.
    403          *        Default: null (no limit).
    404          * @param int $page Optional. The page of results to return. Default:
    405          *        null (no limit).
     407         * @param int    $limit  Optional. The maximum number of items to return.
     408         *                       Default: null (no limit).
     409         * @param int    $page   Optional. The page of results to return. Default:
     410         *                       null (no limit).
     411         *
    406412         * @return array Multidimensional results array, structured as follows:
    407          *           'blogs' - Array of located blog objects
    408          *           'total' - A count of the total blogs matching the query.
     413         *               'blogs' - Array of located blog objects.
     414         *               'total' - A count of the total blogs matching the query.
    409415         */
    410416        public static function search_blogs( $filter, $limit = null, $page = null ) {
     
    438444         *
    439445         * @param int $limit Optional. The maximum number of items to return.
    440          *        Default: null (no limit).
    441          * @param int $page Optional. The page of results to return. Default:
    442          *        null (no limit).
     446         *                   Default: null (no limit).
     447         * @param int $page  Optional. The page of results to return. Default:
     448         *                   null (no limit).
     449         *
    443450         * @return array Multidimensional results array, structured as follows:
    444          *           'blogs' - Array of located blog objects
    445          *           'total' - A count of the total blogs.
     451         *               'blogs' - Array of located blog objects.
     452         *               'total' - A count of the total blogs.
    446453         */
    447454        public static function get_all( $limit = null, $page = null ) {
     
    466473         *
    467474         * @param string $letter. The letter you're looking for.
    468          * @param int $limit Optional. The maximum number of items to return.
    469          *        Default: null (no limit).
    470          * @param int $page Optional. The page of results to return. Default:
    471          *        null (no limit).
     475         * @param int    $limit   Optional. The maximum number of items to return.
     476         *                        Default: null (no limit).
     477         * @param int    $page    Optional. The page of results to return. Default:
     478         *                        null (no limit).
     479         *
    472480         * @return array Multidimensional results array, structured as follows:
    473          *           'blogs' - Array of located blog objects.
    474          *           'total' - A count of the total blogs matching the query.
     481         *               'blogs' - Array of located blog objects.
     482         *               'total' - A count of the total blogs matching the query.
    475483         */
    476484        public static function get_by_letter( $letter, $limit = null, $page = null ) {
     
    505513         *   - The blog description
    506514         *
    507          * @param array $paged_blogs Array of results from the original query.
    508          * @param array $blog_ids Array of IDs returned from the original query.
    509          * @param string|bool $type Not currently used. Default: false.
     515         * @param array       $paged_blogs Array of results from the original query.
     516         * @param array       $blog_ids    Array of IDs returned from the original query.
     517         * @param string|bool $type        Not currently used. Default: false.
     518         *
    510519         * @return array $paged_blogs The located blogs array, with the extras added.
    511520         */
     
    572581         *
    573582         * @param int $blog_id The ID of the blog being checked.
     583         *
    574584         * @return bool True if hidden (public = 0), false otherwise.
    575585         */
     
    589599         * @param int $user_id ID of user.
    590600         * @param int $blog_id ID of blog.
     601         *
    591602         * @return int|bool ID of user-blog link, or false if not found.
    592603         */
Note: See TracChangeset for help on using the changeset viewer.