fix vs_event transformer
This commit is contained in:
parent
6ae202be9a
commit
960d28363b
2 changed files with 8 additions and 6 deletions
|
@ -35,7 +35,7 @@ add_filter(
|
||||||
*/
|
*/
|
||||||
if ( class_exists( 'vsel_widget' ) && $wp_object->post_type === 'event' ) {
|
if ( class_exists( 'vsel_widget' ) && $wp_object->post_type === 'event' ) {
|
||||||
require_once __DIR__ . '/includes/activitypub/transformer/class-vs-event.php';
|
require_once __DIR__ . '/includes/activitypub/transformer/class-vs-event.php';
|
||||||
return new \VS_Event( $object );
|
return new \VS_Event( $wp_object );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -241,10 +241,10 @@ class VS_Event extends Post {
|
||||||
}
|
}
|
||||||
|
|
||||||
$setter_function = 'set_' . $key;
|
$setter_function = 'set_' . $key;
|
||||||
|
|
||||||
if ( in_array($key, get_class_methods( $this ) )) {
|
|
||||||
$getter_function = 'get_' . $key;
|
$getter_function = 'get_' . $key;
|
||||||
$this->ap_object->$setter_function( $this->$getter_function );
|
|
||||||
|
if ( in_array( $getter_function, get_class_methods( $this ) ) ) {
|
||||||
|
$this->ap_object->$setter_function( $this->$getter_function() );
|
||||||
} else {
|
} else {
|
||||||
$this->ap_object->$setter_function( $value );
|
$this->ap_object->$setter_function( $value );
|
||||||
}
|
}
|
||||||
|
@ -299,5 +299,7 @@ class VS_Event extends Post {
|
||||||
->set_in_language( $this->get_locale() )
|
->set_in_language( $this->get_locale() )
|
||||||
->set_actor( get_rest_url_by_path( 'application' ) )
|
->set_actor( get_rest_url_by_path( 'application' ) )
|
||||||
->set_to( array( 'https://www.w3.org/ns/activitystreams#Public' ) );
|
->set_to( array( 'https://www.w3.org/ns/activitystreams#Public' ) );
|
||||||
|
|
||||||
|
return $this->ap_object;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue