diff --git a/CHANGELOG.md b/CHANGELOG.md index 851c56a20..8c125eb13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +* A `pre_activitypub_get_upload_baseurl` filter * Fediverse Preview on post-overview page * GitHub action to enforce Changelog updates. diff --git a/activitypub.php b/activitypub.php index b4d8fea2b..6286e921a 100644 --- a/activitypub.php +++ b/activitypub.php @@ -3,7 +3,7 @@ * Plugin Name: ActivityPub * Plugin URI: https://github.com/pfefferle/wordpress-activitypub/ * Description: The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format. - * Version: 4.2.1 + * Version: 4.2.2 * Author: Matthias Pfefferle & Automattic * Author URI: https://automattic.com/ * License: MIT @@ -19,7 +19,7 @@ use WP_CLI; -\define( 'ACTIVITYPUB_PLUGIN_VERSION', '4.2.1' ); +\define( 'ACTIVITYPUB_PLUGIN_VERSION', '4.2.2' ); // Plugin related constants. \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); diff --git a/includes/functions.php b/includes/functions.php index 7065edb01..9cc1b8aa5 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1478,6 +1478,16 @@ function get_attribution_domains() { * @return string The upload base URL. */ function get_upload_baseurl() { + /** + * Early filter to allow plugins to set the upload base URL. + * + * @param string|false $maybe_upload_dir The upload base URL or false if not set. + */ + $maybe_upload_dir = apply_filters( 'pre_activitypub_get_upload_baseurl', false ); + if ( false !== $maybe_upload_dir ) { + return $maybe_upload_dir; + } + $upload_dir = \wp_get_upload_dir(); /** diff --git a/readme.txt b/readme.txt index d33d59a4c..011220948 100644 --- a/readme.txt +++ b/readme.txt @@ -134,6 +134,7 @@ For reasons of data protection, it is not possible to see the followers of other = Dev = +* Added: A `pre_activitypub_get_upload_baseurl` filter * Added: Fediverse Preview on post-overview page * Added: GitHub action to enforce Changelog updates. * Improved: Outsource Constants to a separate file