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;
|
||||||
|
$getter_function = 'get_' . $key;
|
||||||
|
|
||||||
if ( in_array($key, get_class_methods( $this ) )) {
|
if ( in_array( $getter_function, get_class_methods( $this ) ) ) {
|
||||||
$getter_function = 'get_' . $key;
|
$this->ap_object->$setter_function( $this->$getter_function() );
|
||||||
$this->ap_object->$setter_function( $this->$getter_function );
|
|
||||||
} else {
|
} else {
|
||||||
$this->ap_object->$setter_function( $value );
|
$this->ap_object->$setter_function( $value );
|
||||||
}
|
}
|
||||||
|
@ -290,14 +290,16 @@ class VS_Event extends Post {
|
||||||
->set_type()
|
->set_type()
|
||||||
->set_category()
|
->set_category()
|
||||||
->set_attachments()
|
->set_attachments()
|
||||||
->set_location()
|
->set_location()
|
||||||
->set_comments_enabled( true )
|
->set_comments_enabled( true )
|
||||||
->set_external_participation_url( $this->get_url() )
|
->set_external_participation_url( $this->get_url() )
|
||||||
->set_status( 'CONFIRMED' )
|
->set_status( 'CONFIRMED' )
|
||||||
->set_name( get_the_title( $this->wp_object->ID ) )
|
->set_name( get_the_title( $this->wp_object->ID ) )
|
||||||
->set_is_online( false )
|
->set_is_online( false )
|
||||||
->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