2023-05-24 14:32:00 +00:00
|
|
|
<?php
|
|
|
|
namespace Activitypub\Model;
|
|
|
|
|
|
|
|
use WP_Query;
|
2023-06-01 09:45:07 +00:00
|
|
|
use Activitypub\Signature;
|
2023-07-03 09:20:44 +00:00
|
|
|
use Activitypub\Collection\Users;
|
2023-05-24 14:32:00 +00:00
|
|
|
|
2023-06-01 09:45:07 +00:00
|
|
|
use function Activitypub\get_rest_url_by_path;
|
|
|
|
|
2023-05-24 14:32:00 +00:00
|
|
|
class Application_User extends Blog_User {
|
|
|
|
/**
|
|
|
|
* The User-ID
|
|
|
|
*
|
|
|
|
* @var int
|
|
|
|
*/
|
2023-07-03 09:20:44 +00:00
|
|
|
protected $_id = Users::APPLICATION_USER_ID; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore
|
2023-05-24 14:32:00 +00:00
|
|
|
|
2024-01-18 15:35:52 +00:00
|
|
|
public function get_type() {
|
|
|
|
return 'Application';
|
|
|
|
}
|
2023-05-24 14:32:00 +00:00
|
|
|
|
2024-01-18 15:35:52 +00:00
|
|
|
public function get_discoverable() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_manually_approves_followers() {
|
|
|
|
return true;
|
|
|
|
}
|
2023-09-01 16:32:56 +00:00
|
|
|
|
2023-05-24 14:32:00 +00:00
|
|
|
/**
|
|
|
|
* Get the User-Url.
|
|
|
|
*
|
|
|
|
* @return string The User-Url.
|
|
|
|
*/
|
|
|
|
public function get_url() {
|
2023-06-01 09:45:07 +00:00
|
|
|
return get_rest_url_by_path( 'application' );
|
2023-05-24 14:32:00 +00:00
|
|
|
}
|
2023-05-24 15:40:48 +00:00
|
|
|
|
2023-12-21 09:04:15 +00:00
|
|
|
/**
|
|
|
|
* Returns the User-URL with @-Prefix for the username.
|
|
|
|
*
|
|
|
|
* @return string The User-URL with @-Prefix for the username.
|
|
|
|
*/
|
|
|
|
public function get_alternate_url() {
|
|
|
|
return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() );
|
|
|
|
}
|
|
|
|
|
2023-05-24 15:40:48 +00:00
|
|
|
public function get_name() {
|
2023-06-01 09:45:07 +00:00
|
|
|
return 'application';
|
|
|
|
}
|
|
|
|
|
2023-09-01 16:32:56 +00:00
|
|
|
public function get_preferred_username() {
|
2024-01-18 15:35:52 +00:00
|
|
|
return $this->get_name();
|
2023-05-24 15:40:48 +00:00
|
|
|
}
|
2023-05-31 08:31:49 +00:00
|
|
|
|
2023-06-28 14:43:41 +00:00
|
|
|
public function get_followers() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_following() {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_attachment() {
|
2023-09-22 07:38:59 +00:00
|
|
|
return null;
|
2023-06-28 14:43:41 +00:00
|
|
|
}
|
2023-08-09 11:07:30 +00:00
|
|
|
|
|
|
|
public function get_featured() {
|
2023-09-22 07:38:59 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function get_moderators() {
|
|
|
|
return null;
|
2023-08-09 11:07:30 +00:00
|
|
|
}
|
2023-10-21 09:23:05 +00:00
|
|
|
|
|
|
|
public function get_indexable() {
|
|
|
|
return false;
|
|
|
|
}
|
2023-05-24 14:32:00 +00:00
|
|
|
}
|