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

BLOG link in Profile does not follow WP > General > Reading > Posts Page #288

Closed
stevenjaycohen opened this issue Mar 7, 2023 · 6 comments
Labels

Comments

@stevenjaycohen
Copy link

Screenshot from 2023-03-07 03-02-01
That URL is stevenjaycohen.com/journal/

Screenshot from 2023-03-07 03-03-26
The profile URL is for the Static Front Page (which is correct for the WEBSITE link but incorrect for the BLOG link).

EXPECTED BEHAVIOR
Since the profile has separate links for the Website and the Blog, the Blog Link should follow WordPress's Posts Page setting.

@janboddez
Copy link
Contributor

janboddez commented May 25, 2023

Was wondering if these values could somehow be modified (or even deleted, may not make a lot of sense to have three links to the same site/page) and stumbled upon the activitypub_json_author_array filter.

$json = \apply_filters( 'activitypub_json_author_array', $json, $author_id );

Think that means you could do something like (untested, but it's a start):

add_filter( 'activitypub_json_author_array', function( $json, $author_id ) {
  $json->attachment['blog_url']['value'] = str_replace(
    home_url( '/' ),
    esc_url( get_permalink( get_option( 'page_for_posts' ) ) ), // This should be `https://stevenjaycohen.com/journal/`.
    $json->attachment['blog_url']['value']
  );
 
  return $json;
}, 10, 2 );

Note that this would apply to all authors ... But that could be dealt with, too.

@pfefferle
Copy link
Member

I would love to have a UI for that, so that you will be able to add links and maybe text.

BTW. it is not always the "same" link, it just looks similar in the preview.

In the first step, I add them using a filter, so you could simply remove the hook and add your own: https://github.com/Automattic/wordpress-activitypub/pull/342/files#diff-6cc5f17bb46bd2c49daff4cedaad22399048ee7fa7dd97b3ee2dcfad390fe6d7R36

@janboddez
Copy link
Contributor

In Mastodon, there are up to 4 fields (or 2 times 4, because the labels can also be chosen) that you can fill out as you please. Would make sense to have something similar (on the settings or user profile page, for instance).

But hooks are enough for me :-)

@github-actions
Copy link

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.

@github-actions github-actions bot added the Stale label Sep 29, 2023
@janboddez
Copy link
Contributor

Looks like the filter hook activitypub_json_author_array is no longer in use either?

@github-actions github-actions bot removed the Stale label Sep 30, 2023
Copy link

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.

@github-actions github-actions bot added the Stale label Jan 28, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants