Skip to content

Commit 06c27b5

Browse files
committed
Deprecate wellknown_nodeinfo_data filter
Add backwards compatibility handler using apply_filters_deprecated() to map the old wellknown_nodeinfo_data filter to nodeinfo_discovery.
1 parent 06b58b1 commit 06c27b5

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

includes/class-nodeinfo.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,31 @@ public function register_hooks() {
104104

105105
// Add rewrite rules for well-known endpoints.
106106
\add_action( 'init', array( $this, 'add_rewrite_rules' ), 1 );
107+
108+
// Register deprecated filter handlers.
109+
\add_filter( 'nodeinfo_discovery', array( $this, 'deprecated_wellknown_nodeinfo_data' ), 99 );
110+
}
111+
112+
/**
113+
* Handles the deprecated wellknown_nodeinfo_data filter.
114+
*
115+
* @param array $discovery The discovery document.
116+
* @return array The filtered discovery document.
117+
*/
118+
public function deprecated_wellknown_nodeinfo_data( $discovery ) {
119+
/**
120+
* Filters the NodeInfo discovery document.
121+
*
122+
* @deprecated 3.0.0 Use nodeinfo_discovery instead.
123+
*
124+
* @param array $discovery The discovery document.
125+
*/
126+
return \apply_filters_deprecated(
127+
'wellknown_nodeinfo_data',
128+
array( $discovery ),
129+
'3.0.0',
130+
'nodeinfo_discovery'
131+
);
107132
}
108133

109134
/**

0 commit comments

Comments
 (0)