Closed davemreed closed 1 year ago
You mean like not the post's tags but two "hardcoded" hashtags?
You could probably do the same as before, but slightly modified:
// Post Excerpt with link
add_filter( 'share_on_mastodon_status', function( $status, $post ) {
$status = wp_strip_all_tags( $post->post_excerpt );
$status .= "\n\n" . get_permalink( $post );
$status .= "\n\n" . '#TagOne #TagTwo';
return $status;
}, 10, 2 );
Perfect! Exactly what we needed. Thanks for the great plugin!
Hi Jan,
I'm using this code in our functions file, based on your examples:
// Post Excerpt with link add_filter( 'share_on_mastodon_status', function( $status, $post ) { $status = wp_strip_all_tags( $post->post_excerpt ); $status .= "\n\n" . get_permalink( $post ); return $status; }, 10, 2 );
It's working exactly as expected. I would like to add two specific tags that will be added with every status post, with a line break after the URL. Like this:
I can't quite figure this out. Could you point me in the right direction?