Created
December 27, 2022 04:19
-
-
Save lordmatt/73f42861de7f061825919157c1673597 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Lord Matt embeds Mastodon | |
Plugin URI: https://lordmatt.co.uk/projects/lord-matt-embeds-all-of-mastodon-project/ | |
Description: An attempt to embed Mastodon on WordPress. | |
Version: 1.0.0 | |
Author: @lordmatt@mastodon.social | |
Author URI: https://lordmatt.co.uk/ | |
License: GPLv2 or later | |
Text Domain: lordmatt_embeds_mastodon | |
*/ | |
// Register oEmbed providers | |
function lordmatt_embeds_mastodon() { | |
$instances = array( | |
'mastodon.social','mastodonapp.uk','securitymastod.one','mastodon.nuzgo.net','mstdn.party', | |
'linuxrocks.online','animalliberation.social','fern.surgeplay.com','mastodon.club', | |
'mastodon.irish','mastodon.ninetailed.uk','mastodon.top','meow.social','writing.exchange', | |
'convo.casa','mastodon.cloud','indieweb.social','phpc.social','mstdn.social','mastodon.world', | |
'dmv.community','mas.to','hachyderm.io','tabletop.social','fosstodon.org','toot.cafe', | |
'activism.openworlds.info','kolektiva.social','cryptotalks.social','aus.social', | |
); | |
foreach($instances as $instance){ | |
wp_oembed_add_provider( 'https://'.$instance.'/*', 'https://'.$instance.'/api/oembed', false ); | |
} | |
} | |
add_action( 'init', 'lordmatt_embeds_mastodon' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment