diff --git a/src/bp-blogs/classes/class-bp-blogs-blog.php b/src/bp-blogs/classes/class-bp-blogs-blog.php
index b4d41ac59..f1f40f013 100644
|
a
|
b
|
class BP_Blogs_Blog { |
| 55 | 55 | |
| 56 | 56 | /** |
| 57 | 57 | * Populate the object with data about the specific activity item. |
| | 58 | * |
| | 59 | * @global wpdb $wpdb WordPress database object. |
| 58 | 60 | */ |
| 59 | 61 | public function populate() { |
| 60 | 62 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 71 | 73 | * Save the BP blog data to the database. |
| 72 | 74 | * |
| 73 | 75 | * @return bool True on success, false on failure. |
| | 76 | * |
| | 77 | * @global wpdb $wpdb WordPress database object. |
| 74 | 78 | */ |
| 75 | 79 | public function save() { |
| 76 | 80 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 149 | 153 | * |
| 150 | 154 | * @return int $value The number of associations between the user and blog |
| 151 | 155 | * saved in the blog component tables. |
| | 156 | * |
| | 157 | * @global wpdb $wpdb WordPress database object. |
| 152 | 158 | */ |
| 153 | 159 | public function exists() { |
| 154 | 160 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 188 | 194 | * @return array Multidimensional results array, structured as follows: |
| 189 | 195 | * 'blogs' - Array of located blog objects |
| 190 | 196 | * 'total' - A count of the total blogs matching the filter params |
| | 197 | * |
| | 198 | * @global wpdb $wpdb WordPress database object. |
| 191 | 199 | */ |
| 192 | 200 | public static function get( ...$args ) { |
| 193 | 201 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 325 | 333 | * |
| 326 | 334 | * @param int $blog_id The blog being removed from all users. |
| 327 | 335 | * @return int|bool Number of rows deleted on success, false on failure. |
| | 336 | * |
| | 337 | * @global wpdb $wpdb WordPress database object. |
| 328 | 338 | */ |
| 329 | 339 | public static function delete_blog_for_all( $blog_id ) { |
| 330 | 340 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 343 | 353 | * @param int|null $user_id Optional. The ID of the user from whom the blog is |
| 344 | 354 | * being removed. If absent, defaults to the logged-in user ID. |
| 345 | 355 | * @return int|bool Number of rows deleted on success, false on failure. |
| | 356 | * |
| | 357 | * @global wpdb $wpdb WordPress database object. |
| 346 | 358 | */ |
| 347 | 359 | public static function delete_blog_for_user( $blog_id, $user_id = null ) { |
| 348 | 360 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 361 | 373 | * @param int|null $user_id Optional. The ID of the user whose blog associations |
| 362 | 374 | * are being deleted. If absent, defaults to logged-in user ID. |
| 363 | 375 | * @return int|bool Number of rows deleted on success, false on failure. |
| | 376 | * |
| | 377 | * @global wpdb $wpdb WordPress database object. |
| 364 | 378 | */ |
| 365 | 379 | public static function delete_blogs_for_user( $user_id = null ) { |
| 366 | 380 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 388 | 402 | * @return array Multidimensional results array, structured as follows: |
| 389 | 403 | * 'blogs' - Array of located blog objects. |
| 390 | 404 | * 'total' - A count of the total blogs for the user. |
| | 405 | * |
| | 406 | * @global wpdb $wpdb WordPress database object. |
| 391 | 407 | */ |
| 392 | 408 | public static function get_blogs_for_user( $user_id = 0, $show_hidden = false ) { |
| 393 | 409 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 425 | 441 | * @param int $user_id Optional. ID of the user whose blogs are being |
| 426 | 442 | * queried. Defaults to logged-in user. |
| 427 | 443 | * @return int The number of blogs associated with the user. |
| | 444 | * |
| | 445 | * @global wpdb $wpdb WordPress database object. |
| 428 | 446 | */ |
| 429 | 447 | public static function get_blog_ids_for_user( $user_id = 0 ) { |
| 430 | 448 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 443 | 461 | * @param int $blog_id ID of the blog being queried. |
| 444 | 462 | * @return int|null The ID of the first located entry in the BP table |
| 445 | 463 | * on success, otherwise null. |
| | 464 | * |
| | 465 | * @global wpdb $wpdb WordPress database object. |
| 446 | 466 | */ |
| 447 | 467 | public static function is_recorded( $blog_id ) { |
| 448 | 468 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 464 | 484 | * @param int|null $user_id Optional. ID of the user whose blogs are being |
| 465 | 485 | * queried. Defaults to logged-in user. |
| 466 | 486 | * @return int Blog count for the user. |
| | 487 | * |
| | 488 | * @global wpdb $wpdb WordPress database object. |
| 467 | 489 | */ |
| 468 | 490 | public static function total_blog_count_for_user( $user_id = null ) { |
| 469 | 491 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 495 | 517 | * @return array Multidimensional results array, structured as follows: |
| 496 | 518 | * 'blogs' - Array of located blog objects. |
| 497 | 519 | * 'total' - A count of the total blogs matching the query. |
| | 520 | * |
| | 521 | * @global wpdb $wpdb WordPress database object. |
| 498 | 522 | */ |
| 499 | 523 | public static function search_blogs( $filter, $limit = null, $page = null ) { |
| 500 | 524 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 537 | 561 | * @return array Multidimensional results array, structured as follows: |
| 538 | 562 | * 'blogs' - Array of located blog objects. |
| 539 | 563 | * 'total' - A count of the total blogs. |
| | 564 | * |
| | 565 | * @global wpdb $wpdb WordPress database object. |
| 540 | 566 | */ |
| 541 | 567 | public static function get_all( $limit = null, $page = null ) { |
| 542 | 568 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 571 | 597 | * @return array Multidimensional results array, structured as follows: |
| 572 | 598 | * 'blogs' - Array of located blog objects. |
| 573 | 599 | * 'total' - A count of the total blogs matching the query. |
| | 600 | * |
| | 601 | * @global wpdb $wpdb WordPress database object. |
| 574 | 602 | */ |
| 575 | 603 | public static function get_by_letter( $letter, $limit = null, $page = null ) { |
| 576 | 604 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 612 | 640 | * @param array $blog_ids Array of IDs returned from the original query. |
| 613 | 641 | * @param string|bool $type Not currently used. Default: false. |
| 614 | 642 | * @return array $paged_blogs The located blogs array, with the extras added. |
| | 643 | * |
| | 644 | * @global wpdb $wpdb WordPress database object. |
| 615 | 645 | */ |
| 616 | 646 | public static function get_blog_extras( &$paged_blogs, &$blog_ids, $type = false ) { |
| 617 | 647 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 691 | 721 | * |
| 692 | 722 | * @param int $blog_id The ID of the blog being checked. |
| 693 | 723 | * @return bool True if hidden (public = 0), false otherwise. |
| | 724 | * |
| | 725 | * @global wpdb $wpdb WordPress database object. |
| 694 | 726 | */ |
| 695 | 727 | public static function is_hidden( $blog_id ) { |
| 696 | 728 | global $wpdb; |
| … |
… |
class BP_Blogs_Blog { |
| 708 | 740 | * @param int $user_id ID of user. |
| 709 | 741 | * @param int $blog_id ID of blog. |
| 710 | 742 | * @return int|bool ID of user-blog link, or false if not found. |
| | 743 | * |
| | 744 | * @global wpdb $wpdb WordPress database object. |
| 711 | 745 | */ |
| 712 | 746 | public static function get_user_blog( $user_id, $blog_id ) { |
| 713 | 747 | global $wpdb; |