2023-10-22 22:20:53 +00:00
|
|
|
<?php
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Blog model file.
|
|
|
|
*
|
|
|
|
* @package Activitypub
|
|
|
|
*/
|
|
|
|
|
2023-10-22 22:20:53 +00:00
|
|
|
namespace Activitypub\Model;
|
|
|
|
|
|
|
|
use WP_Query;
|
2024-03-28 09:39:50 +00:00
|
|
|
|
2024-06-27 12:10:38 +00:00
|
|
|
use Activitypub\Signature;
|
|
|
|
use Activitypub\Activity\Actor;
|
2023-10-22 22:20:53 +00:00
|
|
|
use Activitypub\Collection\Users;
|
2024-10-09 12:44:17 +00:00
|
|
|
use Activitypub\Collection\Extra_Fields;
|
2023-10-22 22:20:53 +00:00
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
use function Activitypub\esc_hashtag;
|
2023-10-22 22:20:53 +00:00
|
|
|
use function Activitypub\is_single_user;
|
2024-10-09 12:44:17 +00:00
|
|
|
use function Activitypub\is_blog_public;
|
2023-10-22 22:20:53 +00:00
|
|
|
use function Activitypub\get_rest_url_by_path;
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Blog class.
|
|
|
|
*/
|
2024-06-27 12:10:38 +00:00
|
|
|
class Blog extends Actor {
|
|
|
|
/**
|
|
|
|
* The Featured-Posts.
|
|
|
|
*
|
|
|
|
* @see https://docs.joinmastodon.org/spec/activitypub/#featured
|
|
|
|
*
|
|
|
|
* @context {
|
|
|
|
* "@id": "http://joinmastodon.org/ns#featured",
|
|
|
|
* "@type": "@id"
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $featured;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Moderators endpoint.
|
|
|
|
*
|
|
|
|
* @see https://join-lemmy.org/docs/contributors/05-federation.html
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
protected $moderators;
|
|
|
|
|
2023-10-22 22:20:53 +00:00
|
|
|
/**
|
|
|
|
* The User-ID
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
|
|
|
protected $_id = Users::BLOG_USER_ID; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
|
|
|
|
2024-06-27 12:10:38 +00:00
|
|
|
/**
|
|
|
|
* If the User is indexable.
|
|
|
|
*
|
|
|
|
* @context http://joinmastodon.org/ns#indexable
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
protected $indexable;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The WebFinger Resource.
|
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @var string
|
2024-06-27 12:10:38 +00:00
|
|
|
*/
|
|
|
|
protected $webfinger;
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Whether the User is discoverable.
|
2024-06-27 12:10:38 +00:00
|
|
|
*
|
|
|
|
* @see https://docs.joinmastodon.org/spec/activitypub/#discoverable
|
|
|
|
*
|
|
|
|
* @context http://joinmastodon.org/ns#discoverable
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
protected $discoverable;
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Restrict posting to mods.
|
2024-06-27 12:10:38 +00:00
|
|
|
*
|
|
|
|
* @see https://join-lemmy.org/docs/contributors/05-federation.html
|
|
|
|
*
|
|
|
|
* @var boolean
|
|
|
|
*/
|
|
|
|
protected $posting_restricted_to_mods;
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Whether the User manually approves followers.
|
|
|
|
*
|
|
|
|
* @return false
|
|
|
|
*/
|
2024-03-28 09:39:50 +00:00
|
|
|
public function get_manually_approves_followers() {
|
|
|
|
return false;
|
|
|
|
}
|
2023-10-22 22:20:53 +00:00
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Whether the User is discoverable.
|
|
|
|
*
|
|
|
|
* @return boolean
|
|
|
|
*/
|
2024-03-28 09:39:50 +00:00
|
|
|
public function get_discoverable() {
|
|
|
|
return true;
|
|
|
|
}
|
2023-10-22 22:20:53 +00:00
|
|
|
|
2024-06-27 12:10:38 +00:00
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Get the User ID.
|
2024-06-27 12:10:38 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @return string The User ID.
|
2024-06-27 12:10:38 +00:00
|
|
|
*/
|
|
|
|
public function get_id() {
|
|
|
|
return $this->get_url();
|
2023-10-22 22:20:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the type of the object.
|
|
|
|
*
|
|
|
|
* If the Blog is in "single user" mode, return "Person" insted of "Group".
|
|
|
|
*
|
|
|
|
* @return string The type of the object.
|
|
|
|
*/
|
|
|
|
public function get_type() {
|
|
|
|
if ( is_single_user() ) {
|
|
|
|
return 'Person';
|
|
|
|
} else {
|
|
|
|
return 'Group';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Get the Username.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @return string The Username.
|
2023-10-22 22:20:53 +00:00
|
|
|
*/
|
|
|
|
public function get_name() {
|
|
|
|
return \wp_strip_all_tags(
|
|
|
|
\html_entity_decode(
|
|
|
|
\get_bloginfo( 'name' ),
|
|
|
|
\ENT_QUOTES,
|
|
|
|
'UTF-8'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Get the User description.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @return string The User description.
|
2023-10-22 22:20:53 +00:00
|
|
|
*/
|
|
|
|
public function get_summary() {
|
2024-10-09 12:44:17 +00:00
|
|
|
$summary = \get_option( 'activitypub_blog_description', null );
|
|
|
|
|
|
|
|
if ( ! $summary ) {
|
|
|
|
$summary = \get_bloginfo( 'description' );
|
|
|
|
}
|
|
|
|
|
2023-10-22 22:20:53 +00:00
|
|
|
return \wpautop(
|
|
|
|
\wp_kses(
|
2024-10-09 12:44:17 +00:00
|
|
|
$summary,
|
2023-10-22 22:20:53 +00:00
|
|
|
'default'
|
|
|
|
)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Get the User url.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @return string The User url.
|
2023-10-22 22:20:53 +00:00
|
|
|
*/
|
|
|
|
public function get_url() {
|
|
|
|
return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-02-08 12:31:25 +00:00
|
|
|
* Get blog's homepage URL.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
2024-02-08 12:31:25 +00:00
|
|
|
* @return string The User-Url.
|
2023-10-22 22:20:53 +00:00
|
|
|
*/
|
2024-02-08 12:31:25 +00:00
|
|
|
public function get_alternate_url() {
|
|
|
|
return \esc_url( \trailingslashit( get_home_url() ) );
|
2023-10-22 22:20:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generate a default Username.
|
|
|
|
*
|
|
|
|
* @return string The auto-generated Username.
|
|
|
|
*/
|
|
|
|
public static function get_default_username() {
|
2024-10-09 12:44:17 +00:00
|
|
|
// Check if domain host has a subdomain.
|
2023-10-22 22:20:53 +00:00
|
|
|
$host = \wp_parse_url( \get_home_url(), \PHP_URL_HOST );
|
|
|
|
$host = \preg_replace( '/^www\./i', '', $host );
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Filters the default blog username.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
|
|
|
* @param string $host The default username.
|
|
|
|
*/
|
|
|
|
return apply_filters( 'activitypub_default_blog_username', $host );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Get the preferred Username.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @return string The Username.
|
2023-10-22 22:20:53 +00:00
|
|
|
*/
|
|
|
|
public function get_preferred_username() {
|
2024-10-09 12:44:17 +00:00
|
|
|
$username = \get_option( 'activitypub_blog_identifier' );
|
2023-10-22 22:20:53 +00:00
|
|
|
|
|
|
|
if ( $username ) {
|
|
|
|
return $username;
|
|
|
|
}
|
|
|
|
|
|
|
|
return self::get_default_username();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Get the User icon.
|
2023-10-22 22:20:53 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @return array The User icon.
|
2023-10-22 22:20:53 +00:00
|
|
|
*/
|
|
|
|
public function get_icon() {
|
2024-10-09 12:44:17 +00:00
|
|
|
// Try site_logo, falling back to site_icon, first.
|
2023-10-22 22:20:53 +00:00
|
|
|
$icon_id = get_option( 'site_icon' );
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
// Try custom logo second.
|
2023-10-22 22:20:53 +00:00
|
|
|
if ( ! $icon_id ) {
|
|
|
|
$icon_id = get_theme_mod( 'custom_logo' );
|
|
|
|
}
|
|
|
|
|
|
|
|
$icon_url = false;
|
|
|
|
|
|
|
|
if ( $icon_id ) {
|
|
|
|
$icon = wp_get_attachment_image_src( $icon_id, 'full' );
|
|
|
|
if ( $icon ) {
|
|
|
|
$icon_url = $icon[0];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $icon_url ) {
|
2024-10-09 12:44:17 +00:00
|
|
|
// Fallback to default icon.
|
2023-10-22 22:20:53 +00:00
|
|
|
$icon_url = plugins_url( '/assets/img/wp-logo.png', ACTIVITYPUB_PLUGIN_FILE );
|
|
|
|
}
|
|
|
|
|
|
|
|
return array(
|
|
|
|
'type' => 'Image',
|
|
|
|
'url' => esc_url( $icon_url ),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the User-Header-Image.
|
|
|
|
*
|
|
|
|
* @return array|null The User-Header-Image.
|
|
|
|
*/
|
2024-07-19 19:46:05 +00:00
|
|
|
public function get_image() {
|
2024-10-09 12:44:17 +00:00
|
|
|
$header_image = get_option( 'activitypub_header_image' );
|
|
|
|
$image_url = null;
|
|
|
|
|
|
|
|
if ( $header_image ) {
|
|
|
|
$image_url = \wp_get_attachment_url( $header_image );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( ! $image_url && \has_header_image() ) {
|
|
|
|
$image_url = \get_header_image();
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( $image_url ) {
|
2023-10-22 22:20:53 +00:00
|
|
|
return array(
|
|
|
|
'type' => 'Image',
|
2024-10-09 12:44:17 +00:00
|
|
|
'url' => esc_url( $image_url ),
|
2023-10-22 22:20:53 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Get the published date.
|
|
|
|
*
|
|
|
|
* @return string The published date.
|
|
|
|
*/
|
2023-10-22 22:20:53 +00:00
|
|
|
public function get_published() {
|
|
|
|
$first_post = new WP_Query(
|
|
|
|
array(
|
|
|
|
'orderby' => 'date',
|
|
|
|
'order' => 'ASC',
|
|
|
|
'number' => 1,
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
if ( ! empty( $first_post->posts[0] ) ) {
|
|
|
|
$time = \strtotime( $first_post->posts[0]->post_date_gmt );
|
|
|
|
} else {
|
|
|
|
$time = \time();
|
|
|
|
}
|
|
|
|
|
|
|
|
return \gmdate( 'Y-m-d\TH:i:s\Z', $time );
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Get the canonical URL.
|
|
|
|
*
|
|
|
|
* @return string|null The canonical URL.
|
|
|
|
*/
|
2023-10-22 22:20:53 +00:00
|
|
|
public function get_canonical_url() {
|
|
|
|
return \home_url();
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Get the Moderators endpoint.
|
|
|
|
*
|
|
|
|
* @return string|null The Moderators endpoint.
|
|
|
|
*/
|
2023-10-22 22:20:53 +00:00
|
|
|
public function get_moderators() {
|
|
|
|
if ( is_single_user() || 'Group' !== $this->get_type() ) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return get_rest_url_by_path( 'collections/moderators' );
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Get attributedTo value.
|
|
|
|
*
|
|
|
|
* @return string|null The attributedTo value.
|
|
|
|
*/
|
2023-10-22 22:20:53 +00:00
|
|
|
public function get_attributed_to() {
|
|
|
|
if ( is_single_user() || 'Group' !== $this->get_type() ) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return get_rest_url_by_path( 'collections/moderators' );
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Get the public key information.
|
|
|
|
*
|
|
|
|
* @return array The public key.
|
|
|
|
*/
|
2024-06-27 12:10:38 +00:00
|
|
|
public function get_public_key() {
|
|
|
|
return array(
|
2024-10-09 12:44:17 +00:00
|
|
|
'id' => $this->get_id() . '#main-key',
|
|
|
|
'owner' => $this->get_id(),
|
2024-06-27 12:10:38 +00:00
|
|
|
'publicKeyPem' => Signature::get_public_key_for( $this->get__id() ),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Returns whether posting is restricted to mods.
|
|
|
|
*
|
|
|
|
* @return bool|null True if posting is restricted to mods, null if not applicable.
|
|
|
|
*/
|
2023-10-22 22:20:53 +00:00
|
|
|
public function get_posting_restricted_to_mods() {
|
|
|
|
if ( 'Group' === $this->get_type() ) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2024-06-27 12:10:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Inbox-API-Endpoint.
|
|
|
|
*
|
|
|
|
* @return string The Inbox-Endpoint.
|
|
|
|
*/
|
|
|
|
public function get_inbox() {
|
|
|
|
return get_rest_url_by_path( sprintf( 'actors/%d/inbox', $this->get__id() ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Outbox-API-Endpoint.
|
|
|
|
*
|
|
|
|
* @return string The Outbox-Endpoint.
|
|
|
|
*/
|
|
|
|
public function get_outbox() {
|
|
|
|
return get_rest_url_by_path( sprintf( 'actors/%d/outbox', $this->get__id() ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Followers-API-Endpoint.
|
|
|
|
*
|
|
|
|
* @return string The Followers-Endpoint.
|
|
|
|
*/
|
|
|
|
public function get_followers() {
|
|
|
|
return get_rest_url_by_path( sprintf( 'actors/%d/followers', $this->get__id() ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Following-API-Endpoint.
|
|
|
|
*
|
|
|
|
* @return string The Following-Endpoint.
|
|
|
|
*/
|
|
|
|
public function get_following() {
|
|
|
|
return get_rest_url_by_path( sprintf( 'actors/%d/following', $this->get__id() ) );
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Returns endpoints.
|
|
|
|
*
|
|
|
|
* @return array|null The endpoints.
|
|
|
|
*/
|
2024-06-27 12:10:38 +00:00
|
|
|
public function get_endpoints() {
|
|
|
|
$endpoints = null;
|
|
|
|
|
|
|
|
if ( ACTIVITYPUB_SHARED_INBOX_FEATURE ) {
|
|
|
|
$endpoints = array(
|
|
|
|
'sharedInbox' => get_rest_url_by_path( 'inbox' ),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $endpoints;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a user@domain type of identifier for the user.
|
|
|
|
*
|
|
|
|
* @return string The Webfinger-Identifier.
|
|
|
|
*/
|
|
|
|
public function get_webfinger() {
|
|
|
|
return $this->get_preferred_username() . '@' . \wp_parse_url( \home_url(), \PHP_URL_HOST );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the Featured-API-Endpoint.
|
|
|
|
*
|
|
|
|
* @return string The Featured-Endpoint.
|
|
|
|
*/
|
|
|
|
public function get_featured() {
|
|
|
|
return get_rest_url_by_path( sprintf( 'actors/%d/collections/featured', $this->get__id() ) );
|
|
|
|
}
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Returns whether the site is indexable.
|
|
|
|
*
|
|
|
|
* @return bool Whether the site is indexable.
|
|
|
|
*/
|
2024-06-27 12:10:38 +00:00
|
|
|
public function get_indexable() {
|
2024-10-09 12:44:17 +00:00
|
|
|
if ( is_blog_public() ) {
|
2024-06-27 12:10:38 +00:00
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2024-07-19 19:46:05 +00:00
|
|
|
|
|
|
|
/**
|
2024-10-09 12:44:17 +00:00
|
|
|
* Update the Username.
|
2024-07-19 19:46:05 +00:00
|
|
|
*
|
2024-10-09 12:44:17 +00:00
|
|
|
* @param mixed $value The new value.
|
|
|
|
* @return bool True if the attribute was updated, false otherwise.
|
2024-07-19 19:46:05 +00:00
|
|
|
*/
|
2024-10-09 12:44:17 +00:00
|
|
|
public function update_name( $value ) {
|
|
|
|
return \update_option( 'blogname', $value );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the User description.
|
|
|
|
*
|
|
|
|
* @param mixed $value The new value.
|
|
|
|
* @return bool True if the attribute was updated, false otherwise.
|
|
|
|
*/
|
|
|
|
public function update_summary( $value ) {
|
|
|
|
return \update_option( 'blogdescription', $value );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the User icon.
|
|
|
|
*
|
|
|
|
* @param mixed $value The new value.
|
|
|
|
* @return bool True if the attribute was updated, false otherwise.
|
|
|
|
*/
|
|
|
|
public function update_icon( $value ) {
|
|
|
|
if ( ! wp_attachment_is_image( $value ) ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return \update_option( 'site_icon', $value );
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the User-Header-Image.
|
|
|
|
*
|
|
|
|
* @param mixed $value The new value.
|
|
|
|
* @return bool True if the attribute was updated, false otherwise.
|
|
|
|
*/
|
|
|
|
public function update_header( $value ) {
|
|
|
|
if ( ! wp_attachment_is_image( $value ) ) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
return \update_option( 'activitypub_header_image', $value );
|
|
|
|
}
|
2024-07-19 19:46:05 +00:00
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
/**
|
|
|
|
* Get the User - Hashtags.
|
|
|
|
*
|
|
|
|
* @see https://docs.joinmastodon.org/spec/activitypub/#Hashtag
|
|
|
|
*
|
|
|
|
* @return array The User - Hashtags.
|
|
|
|
*/
|
|
|
|
public function get_tag() {
|
|
|
|
$hashtags = array();
|
|
|
|
|
|
|
|
$args = array(
|
|
|
|
'orderby' => 'count',
|
|
|
|
'order' => 'DESC',
|
|
|
|
'number' => 10,
|
2024-07-19 19:46:05 +00:00
|
|
|
);
|
|
|
|
|
2024-10-09 12:44:17 +00:00
|
|
|
$tags = get_tags( $args );
|
|
|
|
|
|
|
|
foreach ( $tags as $tag ) {
|
|
|
|
$hashtags[] = array(
|
|
|
|
'type' => 'Hashtag',
|
|
|
|
'href' => \get_tag_link( $tag->term_id ),
|
|
|
|
'name' => esc_hashtag( $tag->name ),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return $hashtags;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Extend the User-Output with Attachments.
|
|
|
|
*
|
|
|
|
* @return array The extended User-Output.
|
|
|
|
*/
|
|
|
|
public function get_attachment() {
|
|
|
|
$extra_fields = Extra_Fields::get_actor_fields( $this->_id );
|
|
|
|
return Extra_Fields::fields_to_attachments( $extra_fields );
|
2024-07-19 19:46:05 +00:00
|
|
|
}
|
2023-10-22 22:20:53 +00:00
|
|
|
}
|