|
5 | 5 | * Description: Webmention support for WordPress posts
|
6 | 6 | * Author: Matthias Pfefferle
|
7 | 7 | * Author URI: https://notiz.blog/
|
8 |
| - * Version: 3.8.7 |
| 8 | + * Version: 3.8.8 |
9 | 9 | * License: MIT
|
10 | 10 | * License URI: http://opensource.org/licenses/MIT
|
11 | 11 | * Text Domain: webmention
|
@@ -77,6 +77,9 @@ public static function init() {
|
77 | 77 |
|
78 | 78 | add_action( 'comment_form_after', array( 'Webmention_Plugin', 'comment_form' ), 11 );
|
79 | 79 |
|
| 80 | + add_filter( 'nodeinfo_data', array( 'Webmention_Plugin', 'nodeinfo' ), 10, 2 ); |
| 81 | + add_filter( 'nodeinfo2_data', array( 'Webmention_Plugin', 'nodeinfo2' ), 10 ); |
| 82 | + |
80 | 83 | // remove old Webmention code
|
81 | 84 | remove_action( 'init', array( 'WebMentionFormPlugin', 'init' ) );
|
82 | 85 | remove_action( 'init', array( 'WebMentionForCommentsPlugin', 'init' ) );
|
@@ -127,4 +130,33 @@ public static function pings_open( $open, $post_id ) {
|
127 | 130 | public static function plugin_textdomain() {
|
128 | 131 | load_plugin_textdomain( 'webmention', false, dirname( plugin_basename( __FILE__ ) ) . '/languages' );
|
129 | 132 | }
|
| 133 | + |
| 134 | + /** |
| 135 | + * Extend NodeInfo data |
| 136 | + * |
| 137 | + * @param array $nodeinfo NodeInfo data |
| 138 | + * @param array $version updated data |
| 139 | + */ |
| 140 | + public static function nodeinfo( $nodeinfo, $version ) { |
| 141 | + if ( '2.0' == $version) { |
| 142 | + $nodeinfo['protocols'][] = 'webmention'; |
| 143 | + } else { |
| 144 | + $nodeinfo['protocols']['inbound'][] = 'webmention'; |
| 145 | + $nodeinfo['protocols']['outbound'][] = 'webmention'; |
| 146 | + } |
| 147 | + |
| 148 | + return $nodeinfo; |
| 149 | + } |
| 150 | + |
| 151 | + /** |
| 152 | + * Extend NodeInfo2 data |
| 153 | + * |
| 154 | + * @param array $nodeinfo NodeInfo2 data |
| 155 | + * @param array $version updated data |
| 156 | + */ |
| 157 | + public static function nodeinfo2( $nodeinfo ) { |
| 158 | + $nodeinfo['protocols'][] = 'webmention'; |
| 159 | + |
| 160 | + return $nodeinfo; |
| 161 | + } |
130 | 162 | }
|
0 commit comments