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

Allow the Video block's "View on the original site" text to be filtered #1140

Open
benlk opened this issue Jun 28, 2024 · 1 comment
Open
Labels
enhancement New feature or request help wanted

Comments

@benlk
Copy link

benlk commented Jun 28, 2024

Description

'text' => '<a href="' . esc_url( $url ) . '">' . esc_html( sprintf( __( 'View on %s.', 'apple-news' ), $provider ) ) . '</a>',

I would like a filter to allow the text displayed on the link to be changed.

Use Case

For custom video providers, or for self-hosted videos, I'd like to be able to change this so it doesn't say "the original site" but instead get_bloginfo( 'name' ).

I'd also like to be able to change the "View on" prefix text, to "Watch this video on",

This can be done by sending the complete string (prefix + $provider) to a filter before adding it to the component.

@benlk benlk added the enhancement New feature or request label Jun 28, 2024
@kevinfodness
Copy link
Member

You should be able to filter the generic embed component's JSON and substitute the text for whatever you wish using the apple_news_embed_generic_json filter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted
Projects
None yet
Development

No branches or pull requests

2 participants