PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3
Jetpack – WP Security, Backup, Speed, & Growth v16.3
16.3 16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 All 508 releases
← All changes | jetpack_vendor/automattic/jetpack-classic-theme-helper/src/shared-functions.php +44 -0 16.2-beta → 16.3 View file →
@@ -1,0 +1,44 @@
1 +<?php
2 +/**
3 + * Theme Tools: Functions shared between several features.
4 + *
5 + * @package automattic/jetpack-classic-theme-helper
6 + */
7 +
8 +if ( ! function_exists( 'jetpack_mastodon_get_instance_list' ) ) {
9 +
10 + /**
11 + * Build a list of Mastodon instance hosts.
12 + * That list can be extended via a filter.
13 + *
14 + * @since 0.4.3 in Classic Theme Helper (previously in Jetpack since 11.8)
15 + *
16 + * @return array
17 + */
18 + function jetpack_mastodon_get_instance_list() {
19 + $mastodon_instance_list = array(
20 + // Regex pattern to match any .tld for the mastodon host name.
21 + '#https?:\/\/(www\.)?mastodon\.(\w+)(\.\w+)?#',
22 + // Regex pattern to match any .tld for the mstdn host name.
23 + '#https?:\/\/(www\.)?mstdn\.(\w+)(\.\w+)?#',
24 + 'counter.social',
25 + 'fosstodon.org',
26 + 'gc2.jp',
27 + 'hachyderm.io',
28 + 'infosec.exchange',
29 + 'mas.to',
30 + 'pawoo.net',
31 + );
32 +
33 + /**
34 + * Filter the list of Mastodon instances.
35 + *
36 + * @since 0.4.3 in Classic Theme Helper (previously in Jetpack since 11.8)
37 + *
38 + * @module widgets, theme-tools
39 + *
40 + * @param array $mastodon_instance_list Array of Mastodon instances.
41 + */
42 + return (array) apply_filters( 'jetpack_mastodon_instance_list', $mastodon_instance_list );
43 + }
44 +}