Closed janboddez closed 9 months ago
I just noticed apply_filters( 'activitypub_post', $array, $this->post )
, my bad!
For anyone interested:
add_filter( 'activitypub_post', function( $array, $post ) {
if ( has_category( 'rss-only', $post ) ) { // Just an example.
// Make this post "unlisted."
$array['to'] = array( rest_url( "activitypub/1.0/users/{$post->post_author}/followers" ) );
$array['cc'] = array( 'https://www.w3.org/ns/activitystreams#Public' );
}
return $array;
}, 99, 2 );
No longer works (for me?). I can only guess somehow this hook is no longer called?
This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.
I have posts that are not shown on my home or archive pages. They show in feeds, but they're not followers-only, because anyone with the URL can access them. I call them "unlisted." (Some would call them "RSS Cl...") :-D
Either way, it would be cool if I could also filter the
to
andcc
properties of posts.Might be as simple as adding a filter to https://github.com/Automattic/wordpress-activitypub/blob/ba7f57d6ff346eddba2c3f861c969542227b5fff/includes/model/class-post.php#L169 (although I'm not entirely sure which properties could then be filtered and which could not).