-
Notifications
You must be signed in to change notification settings - Fork 82
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.
/**
* 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 );-
bool$preserveWhether to preserve this post. Default false. -
int$post_idThe ap_post ID being considered for deletion.
bool Whether to preserve this post from deletion.
\apply_filters( 'activitypub_preserve_ap_post', false, $post_id )Follow @[email protected] for updates and news.