alleyinteractive / apple-news

The Publish to Apple News plugin enables your WordPress blog content to be published to your Apple News channel.
https://wordpress.org/plugins/publish-to-apple-news/
GNU General Public License v3.0
152 stars 70 forks source link

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

Open benlk opened 5 days ago

benlk commented 5 days ago

Description

https://github.com/alleyinteractive/apple-news/blob/fcf53754010955514c7d7c8a998d27e45ab9893d/includes/apple-exporter/components/class-embed-generic.php#L257

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.

kevinfodness commented 4 days ago

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.