Thanks for asking about this. While looking into the issue I came across a problem with how the Discourse WordPress plugin is handling YouTube and Vimeo embeds. The fix for that issue might also solve the problem with displaying Wistia videos for topics that are published from WordPress.
I’m assuming you are publishing the posts from WordPress to Discourse with the WP Discourse plugin and that you have enabled the “Use Full Post Content” option that is found on the WP Discourse Publishing options tab. I am also assuming you are using the WordPress block editor and not the Classic editor. Let me know if that is not correct.
If that is how you are publishing the WordPress posts to Discourse, how are you adding the Wistia videos to the WordPress posts? Are you using the “share” link or are you using the video’s embed code to add the videos? I think it’s going to be possible to get this to work if the “share” link is used, but not if the embed code is used.
For (my own) reference, the issue with YouTube and Vimeo videos is here:
When this code was added to the plugin, WordPress video blocks were named based on the video provider. For example core-embed/youtube. WordPress now seems to use the name core/embed for video blocks and specify the provider with the providerNameSlug attribute. For example:
[blockName] => core/embed
[attrs] => Array
(
[url] => https://scossar3.wistia.com/medias/qtp20hbz4i
[type] => video
[providerNameSlug] => wistia-inc
)
The following change to https://github.com/discourse/wp-discourse/blob/main/lib/discourse-publish.php#L284C17-L284C35 fixes the issue with YouTube and Vimeo videos and also allows Wistia videos to be published to Discourse:
( 'core-embed/youtube' === $block['blockName'] || 'core-embed/vimeo' === $block['blockName'] || 'core/embed' === $block['blockName'] )
I’ve only made the change on my local development site. I’ll look at it some more and see if this fix can get added to the WP Discourse plugin’s code.