get_error_message() ), 404 ); } \wp_register_style( 'activitypub-post-preview', ACTIVITYPUB_PLUGIN_URL . '/assets/css/activitypub-post-preview.css', array(), ACTIVITYPUB_PLUGIN_VERSION ); $object = $transformer->to_object(); $user = $transformer->get_actor_object(); $has_images = false; $video = false; $audio = false; $layout = 'layout-1'; foreach ( $object->get_attachment() as $attachment ) { if ( isset( $attachment['mediaType'] ) ) { $media_type = strtok( $attachment['mediaType'], '/' ); switch ( $media_type ) { case 'image': $has_images = true; $layout = 'layout-' . count( wp_list_filter( $object->get_attachment(), array( 'type' => 'Image' ) ) ); break 2; case 'video': $video = $attachment; break 2; case 'audio': $audio = $attachment; break 2; } } } ?> <?php echo esc_html( $object->get_name() ); ?>

Home

<?php echo esc_attr( $user->get_name() ); ?>
get_name() ); ?>
get_webfinger() ); ?>
get_type() && $object->get_name() ) : ?>

get_name() ); ?>

get_type() ? $object->get_summary() : $object->get_content(); // Avoid captions making it through wp_kses. $content_to_display = preg_replace( '/.*?<\/figure>/s', '', $content_to_display ); echo wp_kses( $content_to_display, ACTIVITYPUB_MASTODON_HTML_SANITIZER ); ?>
get_attachment() ) : ?>
get_attachment() as $attachment ) : if ( 'Image' === $attachment['type'] ) : ?> <?php echo esc_attr( $attachment['name'] ?? '' ); ?>
get_tag() ) : ?>
get_tag() as $hashtag ) : ?>