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

@ -9,6 +9,7 @@ namespace Activitypub\Integration;
use Activitypub\Transformer\Post;
use function Activitypub\object_to_uri;
use function Activitypub\generate_post_summary;
/**
@ -28,20 +29,23 @@ class Seriously_Simple_Podcasting extends Post {
* @return array The attachments array.
*/
public function get_attachment() {
$post = $this->wp_object;
$attachments = parent::get_attachment();
$post = $this->item;
$attachment = array(
'type' => \esc_attr( \get_post_meta( $post->ID, 'episode_type', true ) ),
'type' => \esc_attr( ucfirst( \get_post_meta( $post->ID, 'episode_type', true ) ?? 'Audio' ) ),
'url' => \esc_url( \get_post_meta( $post->ID, 'audio_file', true ) ),
'name' => \esc_attr( \get_the_title( $post->ID ) ),
'icon' => \esc_url( \get_post_meta( $post->ID, 'cover_image', true ) ),
'name' => \esc_attr( \get_the_title( $post->ID ) ?? '' ),
);
$attachment = array_filter( $attachment );
array_unshift( $attachments, $attachment );
$icon = \get_post_meta( $post->ID, 'cover_image', true );
if ( ! $icon ) {
$icon = $this->get_icon();
}
return $attachments;
if ( $icon ) {
$attachment['icon'] = \esc_url( object_to_uri( $icon ) );
}
return array( $attachment );
}
/**
@ -63,6 +67,6 @@ class Seriously_Simple_Podcasting extends Post {
* @return string The content.
*/
public function get_content() {
return generate_post_summary( $this->wp_object );
return generate_post_summary( $this->item );
}
}