| 1 |
<?php |
| 2 |
namespace Activitypub\Model; |
| 3 |
|
| 4 |
use WP_Query; |
| 5 |
use Activitypub\Signature; |
| 6 |
use Activitypub\Collection\Users; |
| 7 |
|
| 8 |
use function Activitypub\get_rest_url_by_path; |
| 9 |
|
| 10 |
class Application_User extends Blog_User { |
| 11 |
/** |
| 12 |
* The User-ID |
| 13 |
* |
| 14 |
* @var int |
| 15 |
*/ |
| 16 |
protected $_id = Users::APPLICATION_USER_ID; // phpcs:ignore PSR2.Classes.PropertyDeclaration.Underscore |
| 17 |
|
| 18 |
public function get_type() { |
| 19 |
return 'Application'; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_discoverable() { |
| 23 |
return false; |
| 24 |
} |
| 25 |
|
| 26 |
public function get_manually_approves_followers() { |
| 27 |
return true; |
| 28 |
} |
| 29 |
|
| 30 |
/** |
| 31 |
* Get the User-Url. |
| 32 |
* |
| 33 |
* @return string The User-Url. |
| 34 |
*/ |
| 35 |
public function get_url() { |
| 36 |
return get_rest_url_by_path( 'application' ); |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* Returns the User-URL with @-Prefix for the username. |
| 41 |
* |
| 42 |
* @return string The User-URL with @-Prefix for the username. |
| 43 |
*/ |
| 44 |
public function get_alternate_url() { |
| 45 |
return \esc_url( \trailingslashit( get_home_url() ) . '@' . $this->get_preferred_username() ); |
| 46 |
} |
| 47 |
|
| 48 |
public function get_name() { |
| 49 |
return 'application'; |
| 50 |
} |
| 51 |
|
| 52 |
public function get_preferred_username() { |
| 53 |
return $this->get_name(); |
| 54 |
} |
| 55 |
|
| 56 |
public function get_followers() { |
| 57 |
return null; |
| 58 |
} |
| 59 |
|
| 60 |
public function get_following() { |
| 61 |
return null; |
| 62 |
} |
| 63 |
|
| 64 |
public function get_attachment() { |
| 65 |
return null; |
| 66 |
} |
| 67 |
|
| 68 |
public function get_featured() { |
| 69 |
return null; |
| 70 |
} |
| 71 |
|
| 72 |
public function get_moderators() { |
| 73 |
return null; |
| 74 |
} |
| 75 |
|
| 76 |
public function get_indexable() { |
| 77 |
return false; |
| 78 |
} |
| 79 |
} |
| 80 |
|