Compare commits

..

No commits in common. "ee7612403ceece7aa38717b5bcbb65dfce99505b" and "ca940bfc4e0c1033a98a3ca5228cbb779247509a" have entirely different histories.

2 changed files with 8 additions and 13 deletions

View file

@ -26,13 +26,6 @@ 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
* *
@ -460,6 +453,10 @@ 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;
} }
@ -529,8 +526,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;
} }

View file

@ -25,7 +25,7 @@ use function Activitypub\site_supports_blocks;
* *
* *
*/ */
abstract class Base { // todo renmae to Base_tranformer abstract class Base {
/** /**
* The WP_Post object. * The WP_Post object.
* *
@ -341,8 +341,6 @@ abstract class Base { // todo renmae to Base_tranformer
* @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();
@ -693,7 +691,7 @@ abstract class Base { // todo renmae to Base_tranformer
*/ */
protected function get_basic_content_map() { protected function get_basic_content_map() {
return array( return array(
$this->get_locale() => $this->get_content(), // todo is this a valid assumption? $this->get_locale() => $this->get_content(),
); );
} }
} }