Skip to content

Commit 34bc0d9

Browse files
pfefferleobenland
andauthored
Deprecate some global functions that should no longer be used (#1976)
Co-authored-by: Konstantin Obenland <[email protected]>
1 parent 88591e8 commit 34bc0d9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

includes/functions.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,15 @@ function safe_remote_get( $url ) {
6464
/**
6565
* Returns a users WebFinger "resource".
6666
*
67+
* @deprecated unreleased Use {@see \Activitypub\Webfinger::get_user_resource} instead.
68+
*
6769
* @param int $user_id The user ID.
6870
*
6971
* @return string The User resource.
7072
*/
7173
function get_webfinger_resource( $user_id ) {
74+
\_deprecated_function( __FUNCTION__, 'unreleased', 'Activitypub\Webfinger::get_user_resource' );
75+
7276
return Webfinger::get_user_resource( $user_id );
7377
}
7478

@@ -170,9 +174,13 @@ function url_to_authorid( $url ) {
170174
/**
171175
* Verify that url is a wp_ap_comment or a previously received remote comment.
172176
*
177+
* @deprecated unreleased
178+
*
173179
* @return int|bool Comment ID or false if not found.
174180
*/
175181
function is_comment() {
182+
\_deprecated_function( __FUNCTION__, 'unreleased' );
183+
176184
$comment_id = get_query_var( 'c', null );
177185

178186
if ( ! is_null( $comment_id ) ) {
@@ -483,11 +491,15 @@ function site_supports_blocks() {
483491
/**
484492
* Check if data is valid JSON.
485493
*
494+
* @deprecated unreleased Use {@see \json_decode} instead.
495+
*
486496
* @param string $data The data to check.
487497
*
488498
* @return boolean True if the data is JSON, false otherwise.
489499
*/
490500
function is_json( $data ) {
501+
\_deprecated_function( __FUNCTION__, 'unreleased', 'json_decode' );
502+
491503
return \is_array( \json_decode( $data, true ) );
492504
}
493505

0 commit comments

Comments
 (0)