Changeset 8479
- Timestamp:
- 06/07/2014 06:57:23 PM (10 years ago)
- Location:
- trunk/src/bp-messages
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-messages/bp-messages-actions.php
r6546 r8479 4 4 * BuddyPress Messages Actions 5 5 * 6 * Action functions are exactly the same as screen functions, however they do not7 * have a template screen associated with them. Usually they will send the user8 * back to the default screen after execution.6 * Action functions are exactly the same as screen functions, however they do 7 * not have a template screen associated with them. Usually they will send the 8 * user back to the default screen after execution. 9 9 * 10 10 * @package BuddyPress … … 15 15 if ( !defined( 'ABSPATH' ) ) exit; 16 16 17 /** 18 * Process a request to view a single message thread. 19 */ 17 20 function messages_action_conversation() { 18 21 … … 48 51 add_action( 'bp_actions', 'messages_action_conversation' ); 49 52 53 /** 54 * Process a request to delete a message. 55 * 56 * @return bool False on failure. 57 */ 50 58 function messages_action_delete_message() { 51 59 … … 72 80 add_action( 'bp_actions', 'messages_action_delete_message' ); 73 81 82 /** 83 * Process a request to bulk delete messages. 84 * 85 * @return bool False on failure. 86 */ 74 87 function messages_action_bulk_delete() { 75 88 -
trunk/src/bp-messages/bp-messages-cache.php
r8053 r8479 8 8 * 9 9 * @package BuddyPress 10 * @subpackage SettingsLoader11 10 */ 12 11 … … 25 24 26 25 /** 27 * Clear sunread count cache for each recipient after a message is sent.26 * Clear unread count cache for each recipient after a message is sent. 28 27 * 29 28 * @since BuddyPress (2.0.0) … … 39 38 40 39 /** 41 * Clear sunread count cache for the logged-in user after a message is deleted.40 * Clear unread count cache for the logged-in user after a message is deleted. 42 41 * 43 42 * @since BuddyPress (2.0.0) … … 52 51 53 52 /** 54 * Invalidate scache for notices.55 * 53 * Invalidate cache for notices. 54 * 56 55 * Currently, invalidates active notice cache. 57 56 * -
trunk/src/bp-messages/bp-messages-classes.php
r8099 r8479 521 521 } 522 522 523 /** 524 * Single message class. 525 */ 523 526 class BP_Messages_Message { 527 /** 528 * ID of the message. 529 * 530 * @var int 531 */ 524 532 public $id; 533 534 /** 535 * ID of the message thread. 536 * 537 * @var int 538 */ 525 539 public $thread_id; 540 541 /** 542 * ID of the sender. 543 * 544 * @var int 545 */ 526 546 public $sender_id; 547 548 /** 549 * Subject line of the message. 550 * 551 * @var string 552 */ 527 553 public $subject; 554 555 /** 556 * Content of the message. 557 * 558 * @var string 559 */ 528 560 public $message; 561 562 /** 563 * Date the message was sent. 564 * 565 * @var string 566 */ 529 567 public $date_sent; 530 568 569 /** 570 * Message recipients. 571 * 572 * @var bool|array 573 */ 531 574 public $recipients = false; 532 575 576 /** 577 * Constructor. 578 * 579 * @param int $id Optional. ID of the message. 580 */ 533 581 public function __construct( $id = null ) { 534 582 $this->date_sent = bp_core_current_time(); … … 540 588 } 541 589 590 /** 591 * Set up data related to a specific message object. 592 * 593 * @param int $id ID of the message. 594 */ 542 595 public function populate( $id ) { 543 596 global $wpdb, $bp; … … 553 606 } 554 607 608 /** 609 * Send a message. 610 * 611 * @return int|bool ID of the newly created message on success, false 612 * on failure. 613 */ 555 614 public function send() { 556 615 global $wpdb, $bp; … … 606 665 } 607 666 667 /** 668 * Get a list of recipients for a message. 669 * 670 * @return array 671 */ 608 672 public function get_recipients() { 609 673 global $bp, $wpdb; … … 611 675 } 612 676 613 /** Static Functions ******************************************************/ 614 677 /** Static Functions **************************************************/ 678 679 /** 680 * Get list of recipient IDs from their usernames. 681 * 682 * @param array $recipient_usernames Usernames of recipients. 683 * @return array 684 */ 615 685 public static function get_recipient_ids( $recipient_usernames ) { 616 686 if ( !$recipient_usernames ) … … 628 698 } 629 699 700 /** 701 * Get the ID of the message last sent by the logged-in user for a given thread. 702 * 703 * @param int $thread_id ID of the thread. 704 * @return int|null ID of the message if found, otherwise null. 705 */ 630 706 public static function get_last_sent_for_user( $thread_id ) { 631 707 global $wpdb, $bp; … … 633 709 } 634 710 711 /** 712 * Check whether a user is the sender of a message. 713 * 714 * @param int $user_id ID of the user. 715 * @param int $message_id ID of the message. 716 * @return int|null Returns the ID of the message if the user is the 717 * sender, otherwise null. 718 */ 635 719 public static function is_user_sender( $user_id, $message_id ) { 636 720 global $wpdb, $bp; … … 638 722 } 639 723 724 /** 725 * Get the ID of the sender of a message. 726 * 727 * @param int $message_id ID of the message. 728 * @return int|null The ID of the sender if found, otherwise null. 729 */ 640 730 public static function get_message_sender( $message_id ) { 641 731 global $wpdb, $bp; -
trunk/src/bp-messages/bp-messages-cssjs.php
r7756 r8479 3 3 /** 4 4 * BuddyPress Messages CSS and JS 5 *6 * Apply WordPress defined filters to private messages7 5 * 8 6 * @package BuddyPress … … 13 11 if ( !defined( 'ABSPATH' ) ) exit; 14 12 13 /** 14 * Enqueue the JS for messages autocomplete. 15 */ 15 16 function messages_add_autocomplete_js() { 16 17 … … 29 30 add_action( 'bp_actions', 'messages_add_autocomplete_js' ); 30 31 32 /** 33 * Enqueue the CSS for messages autocomplete. 34 * 35 * @todo Why do we call wp_print_styles()? 36 */ 31 37 function messages_add_autocomplete_css() { 32 38 … … 40 46 add_action( 'wp_head', 'messages_add_autocomplete_css' ); 41 47 48 /** 49 * Print inline JS for initializing the messages autocomplete. 50 * 51 * @todo Why is this here and not in a properly enqueued file? 52 */ 42 53 function messages_autocomplete_init_jsblock() { 43 54 ?>
Note: See TracChangeset
for help on using the changeset viewer.