Changeset 10011 for trunk/src/bp-blogs/bp-blogs-functions.php
- Timestamp:
- 07/11/2015 11:12:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-blogs/bp-blogs-functions.php
r9979 r10011 24 24 25 25 /** 26 * Retrieve a set of blogs 26 * Retrieve a set of blogs. 27 27 * 28 28 * @see BP_Blogs_Blog::get() for a description of arguments and return value. 29 29 * 30 * @param array $args {30 * @param array|string $args { 31 31 * Arguments are listed here with their default values. For more 32 32 * information about the arguments, see {@link BP_Blogs_Blog::get()}. 33 * @type string $typeDefault: 'active'.34 * @type int|bool $user_idDefault: false.35 * @type array $include_blog_idsDefault: false.36 * @type string|bool $search_terms Default: false.37 * @type int $per_pageDefault: 20.38 * @type int $pageDefault: 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. 40 40 * } 41 41 * @return array See {@link BP_Blogs_Blog::get()}. … … 74 74 * @since BuddyPress (1.0.0) 75 75 * 76 * @global object $wpdb WordPress database object 76 * @global object $wpdb WordPress database object. 77 77 * @uses get_users() 78 78 * @uses bp_blogs_record_blog() 79 * 80 * @return bool 79 81 */ 80 82 function bp_blogs_record_existing_blogs() { … … 168 170 * @param int $blog_id ID of the blog being checked. 169 171 * @param int $user_id Optional. ID of the user for whom access is being checked. 172 * 170 173 * @return bool True if blog is recordable, otherwise false. 171 174 */ … … 200 203 * @param int $blog_id ID of the blog being checked. 201 204 * @param int $user_id Optional. ID of the user for whom access is being checked. 205 * 202 206 * @return bool True if blog is trackable, otherwise false. 203 207 */ … … 226 230 * @uses BP_Blogs_Blog 227 231 * 228 * @param int $blog_idID of the blog being recorded.229 * @param int $user_idID 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. 230 234 * @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 * 232 237 * @return bool|null Returns false on failure. 233 238 */ … … 308 313 * 309 314 * @param string $oldvalue Value before save. Passed by do_action() but 310 * unused here.315 * unused here. 311 316 * @param string $newvalue Value to change meta to. 312 317 */ … … 319 324 320 325 /** 321 * Update blog description in BuddyPress blogmeta table 326 * Update blog description in BuddyPress blogmeta table. 322 327 * 323 328 * @global object $wpdb DB Layer. 324 329 * 325 330 * @param string $oldvalue Value before save. Passed by do_action() but 326 * unused here.331 * unused here. 327 332 * @param string $newvalue Value to change meta to. 328 333 */ … … 342 347 * 343 348 * @param string $oldvalue Value before save. Passed by do_action() but 344 * unused here.349 * unused here. 345 350 * @param string $newvalue Value to change meta to. 346 351 */ … … 360 365 * 361 366 * @param string $oldvalue Value before save. Passed by do_action() but 362 * unused here.367 * unused here. 363 368 * @param string $newvalue Value to change meta to. 364 369 */ … … 378 383 * 379 384 * @param string $oldvalue Value before save. Passed by do_action() but 380 * unused here.385 * unused here. 381 386 * @param string $newvalue Value to change meta to. 382 387 */ … … 402 407 * 403 408 * @param string $oldvalue Value before save. Passed by do_action() but 404 * unused here.409 * unused here. 405 410 * @param string $newvalue Value to change meta to. 406 411 */ … … 424 429 * @since BuddyPress (2.3.0) 425 430 * 426 * @param int $site_id The site ID 431 * @param int $site_id The site ID. 427 432 */ 428 433 function bp_blogs_delete_url_blogmeta( $site_id = 0 ) { … … 436 441 * @since BuddyPress (2.2.0) 437 442 * 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. 440 446 */ 441 447 function bp_blogs_publish_post_activity_meta( $activity_id, $post, $args ) { … … 556 562 * Only posts the item if blog is public and post is not password-protected. 557 563 * 558 * @param int $comment_idID of the comment being recorded.564 * @param int $comment_id ID of the comment being recorded. 559 565 * @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 * 561 568 * @return bool|object Returns false on failure, the comment object on success. 562 569 */ … … 737 744 * modify this behavior. 738 745 * 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. 742 749 * 743 750 * @return bool|null False on failure. … … 822 829 823 830 /** 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. 825 832 * 826 833 * WordPress catches add-user-to-blog requests at init:10. In some cases, this … … 929 936 * @param int $blog_id Optional. Defaults to current blog ID. 930 937 * @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 932 941 */ 933 942 function bp_blogs_remove_post( $post_id, $blog_id = 0, $user_id = 0 ) { … … 1054 1063 * 1055 1064 * @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. 1059 1068 */ 1060 1069 function bp_blogs_remove_associated_blog_comments( $activity_ids = array(), $force_delete = true ) { … … 1093 1102 * @param string $new_status New comment status. 1094 1103 * @param string $old_status Previous comment status. 1095 * @param object $comment Comment data.1104 * @param object $comment Comment data. 1096 1105 */ 1097 1106 function bp_blogs_transition_activity_status( $new_status, $old_status, $comment ) { … … 1190 1199 * 1191 1200 * @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 * 1193 1203 * @return int $count Total blog count for the user. 1194 1204 */ … … 1257 1267 * and return values. 1258 1268 * 1259 * @param int $user_idSee {@BP_Blogs_Blog::get_blogs_for_user()}.1269 * @param int $user_id See {@BP_Blogs_Blog::get_blogs_for_user()}. 1260 1270 * @param bool $show_hidden See {@BP_Blogs_Blog::get_blogs_for_user()}. 1271 * 1261 1272 * @return array See {@BP_Blogs_Blog::get_blogs_for_user()}. 1262 1273 */ … … 1271 1282 * 1272 1283 * @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 * 1274 1286 * @return array See {@BP_Blogs_Blog::get_all()}. 1275 1287 */ … … 1284 1296 * 1285 1297 * @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 * 1287 1300 * @return array See {@BP_Blogs_Blog::get()}. 1288 1301 */ … … 1297 1310 * 1298 1311 * @param int $blog_id See {@BP_Blogs_Blog::is_hidden()}. 1312 * 1299 1313 * @return bool See {@BP_Blogs_Blog::is_hidden()}. 1300 1314 */ … … 1317 1331 * @global object $wpdb WordPress database access object. 1318 1332 * 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 * 1328 1344 * @return bool True on success, false on failure. 1329 1345 */ … … 1358 1374 * @global object $wpdb WordPress database access object. 1359 1375 * 1360 * @param int $blog_idID of the blog whose metadata is being requested.1376 * @param int $blog_id ID of the blog whose metadata is being requested. 1361 1377 * @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 * 1367 1384 * @return mixed The meta value(s) being requested. 1368 1385 */ … … 1380 1397 * @global object $wpdb WordPress database access object. 1381 1398 * 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 * 1388 1406 * @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. 1391 1409 */ 1392 1410 function bp_blogs_update_blogmeta( $blog_id, $meta_key, $meta_value, $prev_value = '' ) { … … 1403 1421 * @since BuddyPress (2.0.0) 1404 1422 * 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 * 1411 1430 * @return int|bool The meta ID on successful update, false on failure. 1412 1431 */ … … 1422 1441 * 1423 1442 * @param int $user_id ID whose blog data should be removed. 1443 * 1424 1444 * @return bool|null Returns false on failure. 1425 1445 */ … … 1454 1474 1455 1475 /** 1456 * Restore all blog associations for a given user 1476 * Restore all blog associations for a given user. 1457 1477 * 1458 1478 * @since BuddyPress (2.2.0)
Note: See TracChangeset
for help on using the changeset viewer.