-
Notifications
You must be signed in to change notification settings - Fork 85
activitypub_outbox_{$type}
github-actions[bot] edited this page Mar 12, 2026
·
1 revision
Filters the activity to add to outbox.
Handlers can process the activity and return:
- WP_Post: A WordPress post was created (scheduler adds to outbox)
- int: An outbox post ID (activity already added to outbox)
- WP_Error: Stop processing and return error
- false: Stop processing (activity not allowed)
- array: Modified activity data (fallback to default handling)
- Other: No handler processed the activity (fallback to default)
/**
* Filters the activity to add to outbox.
*
* Handlers can process the activity and return:
* - WP_Post: A WordPress post was created (scheduler adds to outbox)
* - int: An outbox post ID (activity already added to outbox)
* - WP_Error: Stop processing and return error
* - false: Stop processing (activity not allowed)
* - array: Modified activity data (fallback to default handling)
* - Other: No handler processed the activity (fallback to default).
*
* @param array $data
* @param int $user_id
* @param string $visibility
* @return array The filtered value.
*/
function my_activitypub_outbox_{$type}_callback( array $data = null, int $user_id = null, string $visibility = null ) {
// Your code here.
return null;
}
add_filter( 'activitypub_outbox_*', 'my_activitypub_outbox_{$type}_callback' );-
array$dataThe activity data. -
int$user_idThe user ID. -
string$visibilityContent visibility.
\apply_filters( 'activitypub_outbox_' . $type, $data, $user_id, $visibility )Follow @activitypub.blog@activitypub.blog for updates and news.