Skip to content

activitypub_preserve_ap_post

github-actions[bot] edited this page Dec 11, 2025 · 1 revision

Filter whether to preserve a specific ap_post from being purged.

Auto-generated Example

/**
 * Filter whether to preserve a specific ap_post from being purged.
 *
 * @param bool $preserve 
 * @param int  $post_id 
 * @return bool Whether to preserve this post from deletion.
 */
function my_activitypub_preserve_ap_post_callback( bool $preserve, int $post_id ) {
    // Your code here.
    return $preserve;
}
add_filter( 'activitypub_preserve_ap_post', 'my_activitypub_preserve_ap_post_callback', 10, 2 );

Parameters

  • bool $preserve Whether to preserve this post. Default false.
  • int $post_id The ap_post ID being considered for deletion.

Returns

bool Whether to preserve this post from deletion.

Files

\apply_filters( 'activitypub_preserve_ap_post', false, $post_id )

← All Hooks

Users

Developers

Clone this wiki locally