Skip to content

Commit 2b3e7ec

Browse files
authored
mu-plugins: Add support for rel="me" and enable for jquery.com
Closes #437.
1 parent 5bd2cc6 commit 2b3e7ec

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

mu-plugins/jquery-actions.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,19 @@
4242

4343
$events[ 'past' ] = array_reverse( $events[ 'past' ], true );
4444
});
45+
46+
// https://docs.joinmastodon.org/user/profile/#verification
47+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/rel/me
48+
// https://microformats.org/wiki/rel-me
49+
// https://gmpg.org/xfn/
50+
function jquery_xfnrelme_wp_head() {
51+
$sites = jquery_sites();
52+
$links = isset( $sites[ JQUERY_LIVE_SITE ]['xfn-rel-me'] ) ?
53+
$sites[ JQUERY_LIVE_SITE ]['xfn-rel-me'] :
54+
array();
55+
foreach ( $links as $url ) {
56+
echo '<link rel="me" href="' . esc_url( $url ) . '">' . "\n";
57+
}
58+
}
59+
60+
add_action('wp_head', 'jquery_xfnrelme_wp_head');

sites.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ function jquery_sites() {
1010
'blog_id' => 1,
1111
'cookie_domain' => '.jquery.com',
1212
'body_class' => 'jquery',
13+
'xfn-rel-me' => array(
14+
'https://social.lfx.dev/@jquery',
15+
),
1316
'options' => array(
1417
'blogname' => 'jQuery',
1518
'description' => 'jQuery: The Write Less, Do More, JavaScript Library',

0 commit comments

Comments
 (0)