Skip to content

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)

Auto-generated Example

/**
 * 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' );

Parameters

  • array $data The activity data.
  • int $user_id The user ID.
  • string $visibility Content visibility.

Files

\apply_filters( 'activitypub_outbox_' . $type, $data, $user_id, $visibility )

← All Hooks

Users

Developers

Clone this wiki locally