Compare commits
2 commits
ca940bfc4e
...
ee7612403c
Author | SHA1 | Date | |
---|---|---|---|
ee7612403c | |||
25ecff16e7 |
2 changed files with 13 additions and 8 deletions
|
@ -26,6 +26,13 @@ use function Activitypub\snake_to_camel_case;
|
||||||
* @see https://www.w3.org/TR/activitystreams-core/#object
|
* @see https://www.w3.org/TR/activitystreams-core/#object
|
||||||
*/
|
*/
|
||||||
class Base_Object {
|
class Base_Object {
|
||||||
|
/**
|
||||||
|
* if this is set, the next setter call doesn't change anything
|
||||||
|
*
|
||||||
|
* @var bool
|
||||||
|
*/
|
||||||
|
protected $_skip_next;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The object's unique global identifier
|
* The object's unique global identifier
|
||||||
*
|
*
|
||||||
|
@ -453,10 +460,6 @@ class Base_Object {
|
||||||
return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
|
return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $var === 'skip_next' ) {
|
|
||||||
return; // skip_next should never be retrieved publicly
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this->$var;
|
return $this->$var;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,8 +529,8 @@ class Base_Object {
|
||||||
return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
|
return new WP_Error( 'invalid_key', __( 'Invalid key', 'activitypub' ), array( 'status' => 404 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $this->skip_next ) {
|
if ( $this->_skip_next ) {
|
||||||
$this->skip_next = false;
|
$this->_skip_next = false;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ use function Activitypub\site_supports_blocks;
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
abstract class Base {
|
abstract class Base { // todo renmae to Base_tranformer
|
||||||
/**
|
/**
|
||||||
* The WP_Post object.
|
* The WP_Post object.
|
||||||
*
|
*
|
||||||
|
@ -341,6 +341,8 @@ abstract class Base {
|
||||||
* @return string The User-URL.
|
* @return string The User-URL.
|
||||||
*/
|
*/
|
||||||
protected function get_attributed_to() {
|
protected function get_attributed_to() {
|
||||||
|
// todo is this descriptive enough? what if for some people the event should be attributed to the venue?
|
||||||
|
// i would maybe prefer something like "get post author??"
|
||||||
if ( is_single_user() ) { // todo what is if this setting gets changed
|
if ( is_single_user() ) { // todo what is if this setting gets changed
|
||||||
$user = new Blog_User();
|
$user = new Blog_User();
|
||||||
return $user->get_url();
|
return $user->get_url();
|
||||||
|
@ -691,7 +693,7 @@ abstract class Base {
|
||||||
*/
|
*/
|
||||||
protected function get_basic_content_map() {
|
protected function get_basic_content_map() {
|
||||||
return array(
|
return array(
|
||||||
$this->get_locale() => $this->get_content(),
|
$this->get_locale() => $this->get_content(), // todo is this a valid assumption?
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue