-
I was thinking of tweaking my site so that longer "standard format" posts go to ActivityPub as an excerpt and a link, but shorter "status"-format posts are posted as the full content without a link. Is there a hook someone can point me to where I can implement this? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
The plugin has a transformer mechanism. You can hook your own transformer here: Or you can change the "Activity-Object-Type" settings to "WordPress Post-Format" to see if that already does the job!?! |
Beta Was this translation helpful? Give feedback.
-
Terrific, I'll start there! |
Beta Was this translation helpful? Give feedback.
-
FWIW it looks like the add_filter('activitypub_object_content_template', 'avdicodes_activitypub_content_template', 10, 2);
function avdicodes_activitypub_content_template($template, $object) {
$post_format = get_post_format($object) ?: 'standard';
if('standard' === $post_format) {
return "[ap_excerpt]\n\n[ap_permalink type=\"html\"]\n\n[ap_hashtags]";
} else {
return "[ap_content]\n\n[ap_hashtags]";
}
} |
Beta Was this translation helpful? Give feedback.
The plugin has a transformer mechanism. You can hook your own transformer here:
wordpress-activitypub/includes/transformer/class-factory.php
Line 18 in 0be7269
Or you can change the "Activity-Object-Type" settings to "WordPress Post-Format" to see if that already does the job!?!