Compare commits

..

4 commits

6 changed files with 7 additions and 8 deletions

View file

@ -34,7 +34,7 @@ require_once __DIR__ . '/includes/functions.php';
\defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false ); \defined( 'ACTIVITYPUB_AUTHORIZED_FETCH' ) || \define( 'ACTIVITYPUB_AUTHORIZED_FETCH', false );
\defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false ); \defined( 'ACTIVITYPUB_DISABLE_REWRITES' ) || \define( 'ACTIVITYPUB_DISABLE_REWRITES', false );
\defined( 'ACTIVITYPUB_DEFAULT_TRANSFORMER' ) || \define( 'ACTIVITYPUB_DEFAULT_TRANSFORMER', 'activitypub/default' ); \defined( 'ACTIVITYPUB_DEFAULT_TRANSFORMER' ) || \define( 'ACTIVITYPUB_DEFAULT_TRANSFORMER', 'activitypub/default' );
\defined( 'ACTIVITYPUB_JSON_FORMAT_OPTIONS' ) || \define( 'ACTIVITYPUB_JSON_FORMAT_OPTIONS', \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT | \JSON_UNESCAPED_SLASHES);
\define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); \define( 'ACTIVITYPUB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
\define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); \define( 'ACTIVITYPUB_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );

View file

@ -19,7 +19,7 @@ class Actor extends Base_Object {
/** /**
* @var string * @var string
*/ */
protected $type = 'Person'; protected $type = 'Group';
/** /**
* A reference to an ActivityStreams OrderedCollection comprised of * A reference to an ActivityStreams OrderedCollection comprised of

View file

@ -55,9 +55,9 @@ class Blog_User extends User {
*/ */
public function get_type() { public function get_type() {
if ( is_single_user() ) { if ( is_single_user() ) {
return 'Person'; return 'Application';
} else { } else {
return 'Group'; return 'Application';
} }
} }

View file

@ -41,7 +41,7 @@ class User extends Actor {
* *
* @var string * @var string
*/ */
protected $type = 'Person'; protected $type = 'Group';
/** /**
* If the User is discoverable. * If the User is discoverable.

View file

@ -116,7 +116,7 @@ class Post extends Base {
* @return \Activitypub\Activity\Base_Object The ActivityPub Object * @return \Activitypub\Activity\Base_Object The ActivityPub Object
*/ */
public function transform() { public function transform() {
$object = new Base_Objet(); $object = new Base_Object();
$wp_post = $this->get_wp_post(); $wp_post = $this->get_wp_post();
$object->set_id( $this->get_id() ); $object->set_id( $this->get_id() );

View file

@ -20,7 +20,7 @@ if ( \get_query_var( 'pretty' ) ) {
$options |= \JSON_PRETTY_PRINT; // phpcs:ignore $options |= \JSON_PRETTY_PRINT; // phpcs:ignore
} }
$options |= \JSON_HEX_TAG | \JSON_HEX_AMP | \JSON_HEX_QUOT; $options |= ACTIVITYPUB_JSON_FORMAT_OPTIONS;
/* /*
* Options to be passed to json_encode() * Options to be passed to json_encode()
@ -31,7 +31,6 @@ $options = \apply_filters( 'activitypub_json_post_options', $options );
\header( 'Content-Type: application/activity+json' ); \header( 'Content-Type: application/activity+json' );
echo \wp_json_encode( $json, $options ); echo \wp_json_encode( $json, $options );
/* /*
* Action triggerd after the ActivityPub profile has been created and sent to the client * Action triggerd after the ActivityPub profile has been created and sent to the client
*/ */