Skip to content

Instantly share code, notes, and snippets.

@glueckpress
Created May 5, 2019 14:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save glueckpress/23549f9d381f16c1114c7887de77f063 to your computer and use it in GitHub Desktop.
Save glueckpress/23549f9d381f16c1114c7887de77f063 to your computer and use it in GitHub Desktop.
[WordPress][IndieWeb] Customise relme list of the IndieWeb plugin.
<?php
/**
* Plugin Name: IndieWeb | Customisations
* Description: Customises relme list of the IndieWeb plugin.
* Version: 2019.01
* Author: Caspar Hübinger
* Author URI: http://glueckpress.com/
* License: GNU General Public License v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
defined( 'ABSPATH' ) or exit;
add_filter( 'wp_relme_silos', function( $silos ) {
$silos[ 'mastodon' ] = [
'baseurl' => '',
'display' => __( 'Mastodon profile URL', 'indieweb' ),
];
/* LinkedIn is already set up as a contact method by the IndieWeb plugin,
but it’s not included in the h-card relme list, so we’re explicitly
include it here. */
$silos[ 'linkedin' ] = [
'baseurl' => '',
'display' => __( 'LinkedIn profile URL', 'indieweb' ),
];
$silos[ 'wordpress'] = [
'baseurl' => 'https://profiles.wordpress.org/%s/',
'display' => __( 'WordPress.org username', 'indieweb' ),
];
return $silos;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment