私信循环

私信循环

Codex Home → Developer Resources → Loops Reference → Private Messages Loop
Private Messages Loop

The private messages loop can be used to output a user’s private messages, both from their inbox and sentbox.
Standard Loop

There are no messages to display.

Accepted Parameters
The bp_has_message_threads() function will accept a number of parameters that will manipulate the data being returned.

user_id optional
The ID of the user to fetch messages for. By default this will be the user_id of the user currently logged in.

Default value: $bp->loggedin_user->id

box optional
Which box should the loop display messages from?

Accepted arguments: inbox, sentbox, notices
Default value: inbox

per_page optional
The number of messages to display on a page before they are paginated to the next page.

Default value: 10

max optional
The total number of messages to return.

Default value: false (no limit)

Advanced Usage
Fetch inbox messages for the user of ID 12. Get a maximum of 5 messages.

上次修改 2021.12.31