updated plugin ActivityPub version 5.8.0

This commit is contained in:
2025-04-29 21:19:06 +00:00
committed by Gitium
parent 19dfd317cc
commit fdfbf76539
166 changed files with 14119 additions and 7163 deletions

View File

@ -25,25 +25,6 @@ if ( ! function_exists( 'str_starts_with' ) ) {
}
}
if ( ! function_exists( 'get_self_link' ) ) {
/**
* Returns the link for the currently displayed feed.
*
* @return string Correct link for the atom:self element.
*/
function get_self_link() {
$host = wp_parse_url( home_url() );
$path = isset( $_SERVER['REQUEST_URI'] ) ? sanitize_text_field( wp_unslash( $_SERVER['REQUEST_URI'] ) ) : '';
/**
* Filters the self link.
*
* @param string $link The self link.
*/
return esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . $path ) ) );
}
}
if ( ! function_exists( 'is_countable' ) ) {
/**
* Polyfill for `is_countable()` function added in PHP 7.3.
@ -115,3 +96,16 @@ if ( ! function_exists( 'str_contains' ) ) {
return false !== strpos( $haystack, $needle );
}
}
if ( ! function_exists( 'wp_is_serving_rest_request' ) ) {
/**
* Polyfill for `wp_is_serving_rest_request()` function added in WordPress 6.5.
*
* @see https://developer.wordpress.org/reference/functions/wp_is_serving_rest_request/
*
* @return bool True if it's a WordPress REST API request, false otherwise.
*/
function wp_is_serving_rest_request() {
return defined( 'REST_REQUEST' ) && REST_REQUEST;
}
}