Changeset 9993
- Timestamp:
- 07/04/2015 10:17:42 PM (9 years ago)
- Location:
- trunk/src/bp-notifications
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-notifications/bp-notifications-actions.php
r9819 r9993 2 2 3 3 /** 4 * BuddyPress Notifications Actions 4 * BuddyPress Notifications Actions. 5 5 * 6 6 * Action functions are exactly the same as screen functions, however they do not -
trunk/src/bp-notifications/bp-notifications-adminbar.php
r9819 r9993 17 17 * 18 18 * @since BuddyPress (1.9.0) 19 * 20 * @return bool 19 21 */ 20 22 function bp_notifications_toolbar_menu() { -
trunk/src/bp-notifications/bp-notifications-cache.php
r9887 r9993 16 16 * @since BuddyPress (2.3.0) 17 17 * 18 * @param int|str |array$notification_ids Accepts a single notification_id, or a19 * comma-separated list or array of20 * notification ids.18 * @param int|string|array|bool $notification_ids Accepts a single notification_id, or a 19 * comma-separated list or array of 20 * notification ids. 21 21 */ 22 22 function bp_notifications_update_meta_cache( $notification_ids = false ) { … … 32 32 33 33 /** 34 * Clear all notifications cache for a given user ID 34 * Clear all notifications cache for a given user ID. 35 35 * 36 36 * @since BuddyPress (2.3.0) 37 37 * 38 * @param int $user_id The user ID's cache to clear 38 * @param int $user_id The user ID's cache to clear. 39 39 */ 40 40 function bp_notifications_clear_all_for_user_cache( $user_id = 0 ) { -
trunk/src/bp-notifications/bp-notifications-classes.php
r9819 r9993 1 1 <?php 2 2 /** 3 * BuddyPress Notifications Classes 3 * BuddyPress Notifications Classes. 4 4 * 5 5 * Classes used for the Notifications component. -
trunk/src/bp-notifications/bp-notifications-functions.php
r9992 r9993 20 20 * @param array $args { 21 21 * Array of arguments describing the notification. All are optional. 22 * @type int $user_idID of the user to associate the notification with.23 * @type int $item_idID of the item to associate the notification with.24 * @type int $secondary_item_id ID of the secondary item to associate the25 * notification with.26 * @type string $component_name Name of the component to associate the27 * notification with.28 * @type string $component_action Name of the action to associate the29 * notification with.30 * @type string $date_notified Timestamp for the notification.22 * @type int $user_id ID of the user to associate the notification with. 23 * @type int $item_id ID of the item to associate the notification with. 24 * @type int $secondary_item_id ID of the secondary item to associate the 25 * notification with. 26 * @type string $component_name Name of the component to associate the 27 * notification with. 28 * @type string $component_action Name of the action to associate the 29 * notification with. 30 * @type string $date_notified Timestamp for the notification. 31 31 * } 32 32 * @return int|bool ID of the newly created notification on success, false … … 84 84 * 85 85 * @param int $id ID of the notification. 86 * 86 87 * @return BP_Notifications_Notification 87 88 */ … … 96 97 * 97 98 * @param int $id ID of the notification to delete. 99 * 98 100 * @return bool True on success, false on failure. 99 101 */ … … 113 115 * @since BuddyPress (1.9.0) 114 116 * 115 * @param int $id ID of the user whose notifications are being deleted. 116 * @param int $is_new 0 for read, 1 for unread. 117 * @param int $id ID of the user whose notifications are being deleted. 118 * @param int|bool $is_new 0 for read, 1 for unread. 119 * 117 120 * @return bool True on success, false on failure. 118 121 */ … … 134 137 * 135 138 * @param int $user_id ID of the user whose notifications are being fetched. 139 * 136 140 * @return array 137 141 */ … … 168 172 * @since BuddyPress (1.9.0) 169 173 * 170 * @param int $user_id ID of the user whose notifications are being fetched. 171 * @param string $format Format of the returned values. 'string' returns HTML, 172 * while 'object' returns a structured object for parsing. 174 * @param int $user_id ID of the user whose notifications are being fetched. 175 * @param string $format Format of the returned values. 'string' returns HTML, 176 * while 'object' returns a structured object for parsing. 177 * 173 178 * @return mixed Object or array on success, false on failure. 174 179 */ … … 313 318 * @since BuddyPress (1.6.0) 314 319 * 315 * @param Array|Bool $renderable Array of notifications to render or false if no notifications.320 * @param array|bool $renderable Array of notifications to render or false if no notifications. 316 321 * @param int $user_id ID of the user whose notifications are being displayed. 317 322 * @param string $format Display format requested for the notifications. … … 330 335 * @since BuddyPress (1.9.0) 331 336 * 332 * @param int $user_idID of the user whose notifications are being deleted.333 * @param string $component_name Name of the associated component.337 * @param int $user_id ID of the user whose notifications are being deleted. 338 * @param string $component_name Name of the associated component. 334 339 * @param string $component_action Name of the associated action. 340 * 335 341 * @return bool True on success, false on failure. 336 342 */ … … 351 357 * @since BuddyPress (1.9.0) 352 358 * 353 * @param int $user_id ID of the user whose notifications are being deleted. 354 * @param int $item_id ID of the associated item. 355 * @param string $component_name Name of the associated component. 356 * @param string $component_action Name of the associated action. 357 * @param int $secondary_item_id ID of the secondary associated item. 359 * @param int $user_id ID of the user whose notifications are being deleted. 360 * @param int $item_id ID of the associated item. 361 * @param string $component_name Name of the associated component. 362 * @param string $component_action Name of the associated action. 363 * @param int|bool $secondary_item_id ID of the secondary associated item. 364 * 358 365 * @return bool True on success, false on failure. 359 366 */ … … 375 382 * @since BuddyPress (1.9.0) 376 383 * 377 * @param int $item_id ID of the user whose notifications are being deleted. 378 * @param string $component_name Name of the associated component. 379 * @param string $component_action Optional. Name of the associated action. 380 * @param int $secondary_item_id Optional. ID of the secondary associated item. 384 * @param int $item_id ID of the user whose notifications are being deleted. 385 * @param string $component_name Name of the associated component. 386 * @param string|bool $component_action Optional. Name of the associated action. 387 * @param int|bool $secondary_item_id Optional. ID of the secondary associated item. 388 * 381 389 * @return bool True on success, false on failure. 382 390 */ … … 401 409 * @since BuddyPress (1.9.0) 402 410 * 403 * @param int $user_idID of the user whose associated items are being deleted.404 * @param string $component_name Name of the associated component.411 * @param int $user_id ID of the user whose associated items are being deleted. 412 * @param string $component_name Name of the associated component. 405 413 * @param string $component_action Name of the associated action. 414 * 406 415 * @return bool True on success, false on failure. 407 416 */ … … 424 433 * @since BuddyPress (1.9.0) 425 434 * 426 * @param int $user_id ID of the user whose notifications are being deleted. 427 * @param string $component_name Name of the associated component. 428 * @param string $component_action Name of the associated action. 429 * @param int $is_new 0 for read, 1 for unread. 435 * @param int $user_id ID of the user whose notifications are being deleted. 436 * @param string $component_name Name of the associated component. 437 * @param string $component_action Name of the associated action. 438 * @param int|bool $is_new 0 for read, 1 for unread. 439 * 430 440 * @return bool True on success, false on failure. 431 441 */ … … 451 461 * @since BuddyPress (1.9.0) 452 462 * 453 * @param int $user_id ID of the user whose notifications are being deleted. 454 * @param int $item_id ID of the associated item. 455 * @param string $component_name Name of the associated component. 456 * @param string $component_action Name of the associated action. 457 * @param int $secondary_item_id ID of the secondary associated item. 458 * @param int $is_new 0 for read, 1 for unread. 463 * @param int $user_id ID of the user whose notifications are being deleted. 464 * @param int $item_id ID of the associated item. 465 * @param string $component_name Name of the associated component. 466 * @param string $component_action Name of the associated action. 467 * @param int|bool $secondary_item_id ID of the secondary associated item. 468 * @param int|bool $is_new 0 for read, 1 for unread. 469 * 459 470 * @return bool True on success, false on failure. 460 471 */ … … 481 492 * @since BuddyPress (1.9.0) 482 493 * 483 * @param int $user_idID of the user whose notifications are being deleted.484 * @param int $is_new 0 for read, 1 for unread485 * @param string $component_name Name of the associated component.486 * @param string $component_action Optional. Name of the associated action.487 * @param int $secondary_item_id Optional. ID of the secondary associated item.488 * @param int $is_new 0 for read, 1 for unread.494 * @param int $item_id ID of the user whose notifications are being deleted. 495 * @param string $component_name Name of the associated component. 496 * @param string|bool $component_action Optional. Name of the associated action. 497 * @param int|bool $secondary_item_id Optional. ID of the secondary associated item. 498 * @param int|bool $is_new 0 for read, 1 for unread. 499 * 489 500 * @return bool True on success, false on failure. 490 501 */ … … 514 525 * @since BuddyPress (1.9.0) 515 526 * 516 * @param int $user_idID of the user whose associated items are being deleted.517 * @param int $is_new 0 for read, 1 for unread518 * @param string $component_name Name of the associated component.519 * @param string $component_action Name of the associated action.520 * @param int $is_new 0 for read, 1 for unread.527 * @param int $user_id ID of the user whose associated items are being deleted. 528 * @param string $component_name Name of the associated component. 529 * @param string $component_action Name of the associated action. 530 * @param int|bool $is_new 0 for read, 1 for unread. 531 * 521 532 * @return bool True on success, false on failure. 522 533 */ … … 543 554 * @since BuddyPress (1.9.0) 544 555 * 545 * @param int $user_id ID of the user being checked.556 * @param int $user_id ID of the user being checked. 546 557 * @param int $notification_id ID of the notification being checked. 558 * 547 559 * @return bool True if the notification belongs to the user, otherwise false. 548 560 */ … … 557 569 * 558 570 * @param int $user_id ID of the user whose unread notifications are being 559 * counted. 571 * counted. 572 * 560 573 * @return int Unread notification count. 561 574 */ -
trunk/src/bp-notifications/bp-notifications-loader.php
r9936 r9993 11 11 */ 12 12 13 // Exit if accessed directly 13 // Exit if accessed directly. 14 14 defined( 'ABSPATH' ) || exit; 15 15 … … 98 98 * 99 99 * @param array $main_nav Optional. See BP_Component::setup_nav() for 100 * description.101 * @param array $sub_nav Optional. See BP_Component::setup_nav() for102 * description.100 * description. 101 * @param array $sub_nav Optional. See BP_Component::setup_nav() for 102 * description. 103 103 */ 104 104 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { … … 171 171 * 172 172 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() for a 173 * description.173 * description. 174 174 */ 175 175 public function setup_admin_bar( $wp_admin_nav = array() ) { … … 246 246 247 247 /** 248 * Setup cache groups 248 * Setup cache groups. 249 249 * 250 250 * @since BuddyPress (2.2.0) -
trunk/src/bp-notifications/bp-notifications-template.php
r9819 r9993 2 2 3 3 /** 4 * BuddyPress Notifications Template Functions 4 * BuddyPress Notifications Template Functions. 5 5 * 6 6 * @package BuddyPress … … 206 206 207 207 /** 208 * The $_GET argument used in URLs for determining pagination 208 * The $_GET argument used in URLs for determining pagination. 209 209 * 210 210 * @since BuddyPress (1.9.0) … … 251 251 252 252 /** 253 * The direction to sort the results (ASC or DESC) 253 * The direction to sort the results (ASC or DESC). 254 254 * 255 255 * @since BuddyPress (1.9.0) … … 260 260 261 261 /** 262 * Array of variables used in this notification query 262 * Array of variables used in this notification query. 263 263 * 264 264 * @since BuddyPress (2.2.2) … … 434 434 * 435 435 * @return bool True if there are more notifications to show, 436 * otherwise false.436 * otherwise false. 437 437 */ 438 438 public function notifications() { … … 496 496 * @since BuddyPress (1.9.0) 497 497 * 498 * @param array $args {498 * @param array|string $args { 499 499 * Arguments for limiting the contents of the notifications loop. Can be 500 500 * passed as an associative array, or as a URL query string. … … 503 503 * information on the arguments. In addition, also supports: 504 504 * 505 * @type int $maxOptional. Max items to display. Default: false.505 * @type int $max Optional. Max items to display. Default: false. 506 506 * @type string $page_arg URL argument to use for pagination. 507 * Default: 'npage'.507 * Default: 'npage'. 508 508 * } 509 * 510 * @return bool 509 511 */ 510 512 function bp_has_notifications( $args = '' ) { … … 874 876 875 877 /** 876 * Output the URL used for marking a single notification as read 878 * Output the URL used for marking a single notification as read. 877 879 * 878 880 * Since this function directly outputs a URL, it is escaped. … … 886 888 } 887 889 /** 888 * Return the URL used for marking a single notification as read 890 * Return the URL used for marking a single notification as read. 889 891 * 890 892 * @since BuddyPress (2.1.0) … … 952 954 953 955 /** 954 * Output the URL used for marking a single notification as unread 956 * Output the URL used for marking a single notification as unread. 955 957 * 956 958 * Since this function directly outputs a URL, it is escaped. … … 964 966 } 965 967 /** 966 * Return the URL used for marking a single notification as unread 968 * Return the URL used for marking a single notification as unread. 967 969 * 968 970 * @since BuddyPress (2.1.0) … … 1063 1065 1064 1066 /** 1065 * Output the URL used for deleting a single notification 1067 * Output the URL used for deleting a single notification. 1066 1068 * 1067 1069 * Since this function directly outputs a URL, it is escaped. … … 1076 1078 } 1077 1079 /** 1078 * Return the URL used for deleting a single notification 1080 * Return the URL used for deleting a single notification. 1079 1081 * 1080 1082 * @since BuddyPress (2.1.0) … … 1119 1121 * Output the action links for the current notification. 1120 1122 * 1123 * @param array|string $args Array of arguments. 1121 1124 * @since BuddyPress (1.9.0) 1122 1125 */ … … 1129 1132 * @since BuddyPress (1.9.0) 1130 1133 * 1131 * @param array $args {1134 * @param array|string $args { 1132 1135 * @type string $before HTML before the links. 1133 * @type string $after HTML after the links.1134 * @type string $sep HTML between the links.1135 * @type array $linksArray of links to implode by 'sep'.1136 * @type string $after HTML after the links. 1137 * @type string $sep HTML between the links. 1138 * @type array $links Array of links to implode by 'sep'. 1136 1139 * } 1137 1140 * … … 1232 1235 1233 1236 /** 1234 * Output the form for changing the sort order of notifications 1237 * Output the form for changing the sort order of notifications. 1235 1238 * 1236 1239 * @since BuddyPress (1.9.0) -
trunk/src/bp-notifications/classes/class-bp-notifications-notification.php
r9887 r9993 1 1 <?php 2 2 /** 3 * BuddyPress Notifications Classes 3 * BuddyPress Notifications Classes. 4 4 * 5 5 * Classes used for the Notifications component. … … 103 103 * 104 104 * @param int $id Optional. Provide an ID to access an existing 105 * notification item.105 * notification item. 106 106 */ 107 107 public function __construct( $id = 0 ) { … … 145 145 * @since BuddyPress (2.0.0) 146 146 * 147 * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference.147 * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference. 148 148 */ 149 149 do_action_ref_array( 'bp_notification_before_save', array( &$this ) ); … … 171 171 * @since BuddyPress (2.0.0) 172 172 * 173 * @param BP_Notifications_Notification Current instance of the notification item being saved. Passed by reference.173 * @param BP_Notifications_Notification $value Current instance of the notification item being saved. Passed by reference. 174 174 */ 175 175 do_action_ref_array( 'bp_notification_after_save', array( &$this ) ); … … 216 216 * @param array $data { 217 217 * Array of notification data, passed to {@link wpdb::insert()}. 218 * @type int $user_id ID of the associated user. 219 * @type int $item_id ID of the associated item. 220 * @type int $secondary_item_id ID of the secondary associated item. 221 * @type string $component_name Name of the associated component. 222 * @type string $component_action Name of the associated component 223 * action. 224 * @type string $date_notified Timestamp of the notification. 225 * @type bool $is_new True if the notification is unread, otherwise 226 * false. 218 * @type int $user_id ID of the associated user. 219 * @type int $item_id ID of the associated item. 220 * @type int $secondary_item_id ID of the secondary associated item. 221 * @type string $component_name Name of the associated component. 222 * @type string $component_action Name of the associated component 223 * action. 224 * @type string $date_notified Timestamp of the notification. 225 * @type bool $is_new True if the notification is unread, otherwise false. 227 226 * } 228 227 * @param array $data_format See {@link wpdb::insert()}. … … 241 240 * @see wpdb::update() for further description of paramater formats. 242 241 * 243 * @param array $data Array of notification data to update, passed to244 * {@link wpdb::update()}. Accepts any property of a245 * BP_Notification_Notification object.246 * @param array $where The WHERE params as passed to wpdb::update().247 * Typically consists of array( 'ID' => $id ) to specify the ID248 * of the item being updated. See {@link wpdb::update()}.249 * @param array $data_format See {@link wpdb::insert()}.242 * @param array $data Array of notification data to update, passed to 243 * {@link wpdb::update()}. Accepts any property of a 244 * BP_Notification_Notification object. 245 * @param array $where The WHERE params as passed to wpdb::update(). 246 * Typically consists of array( 'ID' => $id ) to specify the ID 247 * of the item being updated. See {@link wpdb::update()}. 248 * @param array $data_format See {@link wpdb::insert()}. 250 249 * @param array $where_format See {@link wpdb::insert()}. 250 * 251 251 * @return int|false The number of rows updated, or false on error. 252 252 */ … … 263 263 * @see wpdb::update() for further description of paramater formats. 264 264 * 265 * @param array $where Array of WHERE clauses to filter by, passed to266 * {@link wpdb::delete()}. Accepts any property of a267 * BP_Notification_Notification object.265 * @param array $where Array of WHERE clauses to filter by, passed to 266 * {@link wpdb::delete()}. Accepts any property of a 267 * BP_Notification_Notification object. 268 268 * @param array $where_format See {@link wpdb::insert()}. 269 * 269 270 * @return int|false The number of rows updated, or false on error. 270 271 */ … … 282 283 * @since BuddyPress (1.9.0) 283 284 * 284 * @param array $args See {@link BP_Notifications_Notification::get()} 285 * for more details. 285 * @param array $args See {@link BP_Notifications_Notification::get()} 286 * for more details. 287 * @param string $select_sql SQL SELECT fragment. 288 * @param string $from_sql SQL FROM fragment. 289 * @param string $join_sql SQL JOIN fragment. 290 * @param string $meta_query_sql SQL meta query fragment. 291 * 286 292 * @return string WHERE clause. 287 293 */ … … 404 410 * 405 411 * @param array $args See {@link BP_Notifications_Notification::get()} 406 * for more details. 412 * for more details. 413 * 407 414 * @return string ORDER BY clause. 408 415 */ … … 441 448 * 442 449 * @param array $args See {@link BP_Notifications_Notification::get()} 443 * for more details. 450 * for more details. 451 * 444 452 * @return string LIMIT clause. 445 453 */ … … 468 476 * 469 477 * - associative arrays whose key/value pairs are column => value, to 470 * be used in WHERE, SET, or VALUES clauses 478 * be used in WHERE, SET, or VALUES clauses. 471 479 * - arrays of "formats", which tell $wpdb->prepare() which type of 472 480 * value to expect when sanitizing (eg, array( '%s', '%d' )) … … 497 505 * @since BuddyPress (1.9.0) 498 506 * 499 * @param $args Associative array of filter arguments. 500 * See {@BP_Notifications_Notification::get()} for a breakdown. 507 * @param array $args Associative array of filter arguments. 508 * See {@BP_Notifications_Notification::get()} 509 * for a breakdown. 510 * 501 511 * @return array Associative array of 'data' and 'format' args. 502 512 */ … … 559 569 * @since BuddyPress (1.9.0) 560 570 * 561 * @param int $user_id ID of the user being checked.571 * @param int $user_id ID of the user being checked. 562 572 * @param int $notification_id ID of the notification being checked. 573 * 563 574 * @return bool True if the notification belongs to the user, otherwise 564 * false.575 * false. 565 576 */ 566 577 public static function check_access( $user_id, $notification_id ) { … … 573 584 574 585 /** 575 * Parse notifications query arguments 586 * Parse notifications query arguments. 576 587 * 577 588 * @since BuddyPress 2.3.0 … … 609 620 * $per_page can be treated as filter values for get_where_sql() 610 621 * and get_query_clauses(). All items are optional. 611 * @type int|array $idID of notification being updated. Can be an612 * array of IDs.613 * @type int|array $user_idID of user being queried. Can be an614 * array of user IDs.615 * @type int|array $item_idID of associated item. Can be an array616 * of multiple item IDs.617 * @type int|array $secondary_item_id ID of secondary associated618 * item. Can be an array of multiple IDs.619 * @type string|array $component_name Name of the component to620 * filter by. Can be an array of component names.621 * @type string|array $component_action Name of the action to622 * filter by. Can be an array of actions.623 * @type bool $is_newWhether to limit to new notifications. True624 * returns only new notifications, false returns only non-new625 * notifications. 'both' returns all. Default: true.626 * @type string $search_termsTerm to match against component_name627 * or component_action fields.628 * @type string $order_byDatabase column to order notifications by.629 * @type string $sort_orderEither 'ASC' or 'DESC'.630 * @type string $order_byField to order results by.631 * @type string $sort_orderASC or DESC.632 * @type int $pageNumber of the current page of results. Default:633 * false (no pagination - all items).634 * @type int $per_pageNumber of items to show per page. Default:635 * false (no pagination - all items).622 * @type int|array $id ID of notification being updated. Can be an 623 * array of IDs. 624 * @type int|array $user_id ID of user being queried. Can be an 625 * array of user IDs. 626 * @type int|array $item_id ID of associated item. Can be an array 627 * of multiple item IDs. 628 * @type int|array $secondary_item_id ID of secondary associated 629 * item. Can be an array of multiple IDs. 630 * @type string|array $component_name Name of the component to 631 * filter by. Can be an array of component names. 632 * @type string|array $component_action Name of the action to 633 * filter by. Can be an array of actions. 634 * @type bool $is_new Whether to limit to new notifications. True 635 * returns only new notifications, false returns only non-new 636 * notifications. 'both' returns all. Default: true. 637 * @type string $search_terms Term to match against component_name 638 * or component_action fields. 639 * @type string $order_by Database column to order notifications by. 640 * @type string $sort_order Either 'ASC' or 'DESC'. 641 * @type string $order_by Field to order results by. 642 * @type string $sort_order ASC or DESC. 643 * @type int $page Number of the current page of results. Default: 644 * false (no pagination - all items). 645 * @type int $per_page Number of items to show per page. Default: 646 * false (no pagination - all items). 636 647 * } 637 648 * @return array Located notifications. … … 698 709 * 699 710 * @param array $args See {@link BP_Notifications_Notification::get()}. 711 * 700 712 * @return int Count of located items. 701 713 */ … … 754 766 * @param array $meta_query An array of meta_query filters. See the 755 767 * documentation for WP_Meta_Query for details. 768 * 756 769 * @return array $sql_array 'join' and 'where' clauses. 757 770 */ … … 795 808 * @param array $date_query An array of date_query parameters. See the 796 809 * documentation for the first parameter of WP_Date_Query. 810 * 797 811 * @return string 798 812 */ … … 820 834 * 821 835 * @param array $update_args Associative array of fields to update, 822 * and the values to update them to. Of the format 823 * array( 'user_id' => 4, 'component_name' => 'groups', ) 824 * @param array $where_args Associative array of columns/values, to 825 * determine which rows should be updated. Of the format 826 * array( 'item_id' => 7, 'component_action' => 'members', ) 836 * and the values to update them to. Of the format 837 * array( 'user_id' => 4, 'component_name' => 'groups', ) 838 * @param array $where_args Associative array of columns/values, to 839 * determine which rows should be updated. Of the format 840 * array( 'item_id' => 7, 'component_action' => 'members', ) 841 * 827 842 * @return int|bool Number of rows updated on success, false on failure. 828 843 */ … … 858 873 * 859 874 * @param array $args Associative array of columns/values, to determine 860 * which rows should be deleted. Of the format 861 * array( 'item_id' => 7, 'component_action' => 'members', ) 875 * which rows should be deleted. Of the format 876 * array( 'item_id' => 7, 'component_action' => 'members', ) 877 * 862 878 * @return int|bool Number of rows deleted on success, false on failure. 863 879 */ … … 890 906 * 891 907 * @param int $id ID of the notification item to be deleted. 908 * 892 909 * @return bool True on success, false on failure. 893 910 */ … … 903 920 * @since BuddyPress (1.9.0) 904 921 * 905 * @param int $user_id ID of the user whose notifications are being 906 * fetched. 907 * @param string $status Optional. Status of notifications to fetch. 908 * 'is_new' to get only unread items, 'all' to get all. 922 * @param int $user_id ID of the user whose notifications are being 923 * fetched. 924 * @param string $status Optional. Status of notifications to fetch. 925 * 'is_new' to get only unread items, 'all' to get all. 926 * 909 927 * @return array Associative array of notification items. 910 928 */ … … 922 940 * 923 941 * @param int $user_id ID of the user whose notifications are being 924 * fetched. 942 * fetched. 943 * 925 944 * @return array Associative array of unread notification items. 926 945 */ … … 938 957 * 939 958 * @param int $user_id ID of the user whose notifications are being 940 * fetched. 959 * fetched. 960 * 941 961 * @return array Associative array of unread notification items. 942 962 */ … … 955 975 * @param array $args { 956 976 * Array of arguments. 957 * @type int $user_idID of the user for whom the notifications are958 * being fetched. Default: logged-in user ID.959 * @type bool $is_newWhether to limit the query to unread960 * notifications. Default: true.961 * @type int $pageNumber of the page to return. Default: 1.962 * @type int $per_pageNumber of results to display per page.963 * Default: 10.977 * @type int $user_id ID of the user for whom the notifications are 978 * being fetched. Default: logged-in user ID. 979 * @type bool $is_new Whether to limit the query to unread 980 * notifications. Default: true. 981 * @type int $page Number of the page to return. Default: 1. 982 * @type int $per_page Number of results to display per page. 983 * Default: 10. 964 984 * @type string $search_terms Optional. A term to search against in 965 * the 'component_name' and 'component_action' columns.985 * the 'component_name' and 'component_action' columns. 966 986 * } 967 987 * @return array { 968 988 * @type array $notifications Array of notification results. 969 * @type int $totalCount of all located notifications matching970 * the query params.989 * @type int $total Count of all located notifications matching 990 * the query params. 971 991 * } 972 992 */ … … 999 1019 * @since BuddyPress (1.9.0) 1000 1020 * 1001 * @param int $user_id The ID of the user who the notifications 1002 * are for. 1003 * @param int $is_new Mark as read (1) or unread (0). 1021 * @param int $user_id The ID of the user who the notifications are for. 1022 * @param int $is_new Mark as read (1) or unread (0). 1023 * @param int $item_id Item ID being acted on. 1024 * @param string $component_name Name of component the notifications are for. 1025 * @param string $component_action Name of the component action. 1026 * @param int $secondary_item_id The ID of the secondary item. 1027 * 1028 * @return bool|int False on failure to update. ID on success. 1004 1029 */ 1005 1030 public static function mark_all_for_user( $user_id, $is_new = 0, $item_id = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) { … … 1039 1064 * @since BuddyPress (1.9.0) 1040 1065 * 1041 * @param int $user_id The ID of the user who the notifications are from. 1042 * @param int $is_new Mark as read (1) or unread (0). 1066 * @param int $user_id The ID of the user who the notifications are from. 1067 * @param int $is_new Mark as read (1) or unread (0). 1068 * @param string $component_name Name of component the notifications are for. 1069 * @param string $component_action Name of the component action. 1070 * @param int $secondary_item_id The ID of the secondary item. 1071 * 1072 * @return bool|int 1043 1073 */ 1044 1074 public static function mark_all_from_user( $user_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) { … … 1075 1105 * @since BuddyPress (1.9.0) 1076 1106 * 1077 * @param int $item_id The ID of the item associated with the 1078 * notifications. 1079 * @param string $component_name The component that the notifications 1080 * are associated with. 1081 * @param string $component_action The action that the notifications 1082 * are associated with. 1083 * @param string $secondary_item_id Optional. ID of the secondary 1084 * associated item. 1107 * @param int $item_id The ID of the item associated with the 1108 * notifications. 1109 * @param int $is_new Mark as read (1) or unread (0). 1110 * @param string $component_name The component that the notifications 1111 * are associated with. 1112 * @param string $component_action The action that the notifications 1113 * are associated with. 1114 * @param int $secondary_item_id Optional. ID of the secondary 1115 * associated item. 1116 * 1117 * @return bool|int 1085 1118 */ 1086 1119 public static function mark_all_by_type( $item_id, $is_new = 0, $component_name = '', $component_action = '', $secondary_item_id = 0 ) {
Note: See TracChangeset
for help on using the changeset viewer.