Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Tag a user by default #836

Open
ethicalrevolution opened this issue Aug 1, 2024 · 2 comments
Open

Feature Request: Tag a user by default #836

ethicalrevolution opened this issue Aug 1, 2024 · 2 comments

Comments

@ethicalrevolution
Copy link

ethicalrevolution commented Aug 1, 2024

What

I’m trying to tag a group in order that my posts made on Wordpress automatically publish to that group.

Specifically:
If I make a post from Mastodon and tag @[email protected] then my post gets sent out to anybody who follows the Spurs Group. I am trying to perform the same action but from my Wordpress account. I’ve tried adding all of the following in the ‘Post Content’ section of the ActivityPub settings in Wordpress but none of them successfully tag the account:

<a href="/@[email protected]">@[email protected]</a>
<a href="https://a.gup.pe/u/spurs">@[email protected]</a>
<a href="https://a.gup.pe/@spurs">@[email protected]</a>

Is there a current work around to be able to automatically tag another Fediverse user account? If not then could I make this a feature request?

Why

I have created a website specifically to post updates to a Guppe group on Mastodon, so I need to be able to tag the Guppe group account in order for it to be shared to the members of the group.

How

By having the correct tag in the penultimate line of this screenshot.
IMG_2231

@ethicalrevolution
Copy link
Author

ethicalrevolution commented Aug 17, 2024

I’ve managed a workaround for this by adding the following code to my functions.php file:

/** always tag spurs group */

add_filter( 'the_content', 'filter_the_content_in_the_main_loop' );

function filter_the_content_in_the_main_loop( $content ) {

// Check if we're inside the main loop in a single post page.
if ( is_single() && in_the_loop() && is_main_query() ) {

   return esc_html__("@[email protected]").$content;
}

return $content;

}

@ethicalrevolution
Copy link
Author

ethicalrevolution commented Aug 18, 2024

Bah, turns out the functions fix only works for new posts, but not for replies to existing posts using the ActivityPub plugin 'reply from' bookmarklet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant