Skip to content

Commit

Permalink
Merge branch 'trunk' into trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
pfefferle authored Feb 5, 2025
2 parents bc5f587 + 84c6cbf commit 41e9481
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 49 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

* Manually granting `activitypub` cap no longer requires the receiving user to have `publish_post`.
* Allow omitting replies in ActivityPub representations instead of setting them as empty.
* Allow Base Transformer to handle WP_Term objects for transformation.

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion includes/class-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function get_activitypub_object() {
/**
* Get the ActivityPub object ID.
*
* @return int The ActivityPub object ID.
* @return string The ActivityPub object ID.
*/
public function get_activitypub_object_id() {
if ( $this->activitypub_object_id ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/collection/class-interactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static function add_reaction( $activity ) {
$comment_post_id = $parent_comment->comment_post_ID;
}

if ( ! $comment_post_id ) {
if ( ! $comment_post_id || is_post_disabled( $comment_post_id ) ) {
// Not a reply to a post or comment.
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion includes/collection/class-replies.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private static function get_id( $wp_object ) {
*
* @param WP_Post|WP_Comment $wp_object The post or comment to fetch replies for.
*
* @return array An associative array containing the replies collection without JSON-LD context.
* @return array|null An associative array containing the replies collection without JSON-LD context.
*/
public static function get_collection( $wp_object ) {
$id = self::get_id( $wp_object );
Expand Down
2 changes: 1 addition & 1 deletion includes/transformer/class-base.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public function get_media_type() {
/**
* Get the replies Collection.
*
* @return array The replies collection.
* @return array|null The replies collection on success or null on failure.
*/
public function get_replies() {
return Replies::get_collection( $this->item );
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ For reasons of data protection, it is not possible to see the followers of other
* Added: Third-party plugins can filter settings tabs to add their own settings pages for ActivityPub.
* Changed: Manually granting `activitypub` cap no longer requires the receiving user to have `publish_post`.
* Changed: Allow Base Transformer to handle WP_Term objects for transformation.
* Changed: Allow omitting replies in ActivityPub representations instead of setting them as empty.
* Fixed: Negotiation of ActivityPub requests for custom post types when queried by the ActivityPub ID.
* Fixed: Avoid PHP warnings when using Debug mode and when the `actor` is not set.
* Fixed: No longer creates Outbox items when importing content/users.
Expand Down
Loading

0 comments on commit 41e9481

Please sign in to comment.