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

CAP does not filter the byline that is output for posts via oEmbed; oEmbed consumers show the wrong byline #921

Open
benlk opened this issue Jan 27, 2023 · 8 comments

Comments

@benlk
Copy link
Contributor

benlk commented Jan 27, 2023

Here's a test post by a WP_User:

{
  "version": "1.0",
  "provider_name": "largo.test",
  "provider_url": "https://largo.test",
  "author_name": "WP Snapshots WP_User",
  "author_url": "https://largo.test/author/wpsnapshots/",
  "title": "Post by WP_User",
  "type": "rich",
....

And here's a test post by a Coauthor:

{
  "version": "1.0",
  "provider_name": "largo.test",
  "provider_url": "https://largo.test",
  "author_name": "WP Snapshots WP_User",
  "author_url": "https://largo.test/author/wpsnapshots/",
  "title": "Post by Guest Author",
  "type": "rich",
....
@benlk
Copy link
Contributor Author

benlk commented Feb 11, 2023

get_oembed_response_data is what provides the author and author_url keys there; it provides a filter oembed_response_data that allows us to change the response.

@benlk
Copy link
Contributor Author

benlk commented Feb 13, 2023

The problem is that it doesn't look like oEmbed supports multiple authorship: iamcal/oembed#686

@benlk
Copy link
Contributor Author

benlk commented Mar 21, 2023

In the case of multiple bylines, since there's no support for multiple distinct authors and respective URLs, it may be easiest to do the following:

  1. author_name: use the CAP's byline generation function, then strip tags
  2. author_url: link to either the embedded page itself, or no URL

@jeffpaul
Copy link

@rebeccahum any thoughts from the team on an answer here or potential direction on any respective changes that could be contributed?

@rebeccahum
Copy link
Contributor

Can you give more detail on what is trying to be achieved here with steps on reproduction?

Thanks!

@benlk
Copy link
Contributor Author

benlk commented Apr 24, 2023

The goal here is to have Slack and other oEmbed consumers show the correct author(s) in the byline. It doesn't appear that that is the case with the current version of CAP.

@benlk benlk changed the title Does CAP filter the byline that is output for posts via oEmbed? CAP does not filter the byline that is output for posts via oEmbed; oEmbed consumers show the wrong byline Apr 24, 2023
@rebeccahum
Copy link
Contributor

Cool, feel free to open a PR for our review 🙂

@GaryJones
Copy link
Contributor

Until the oembed spec changes (thanks for opening that issue), then I think the best we can do is make sure the author that is shown is the first / one of the Coauthors.

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

4 participants