transformer_refactoring #44

Merged
linos merged 42 commits from transformer_refactoring into main 2024-10-02 19:15:29 +02:00
3 changed files with 35 additions and 11 deletions
Showing only changes of commit 4f61a1c97e - Show all commits

View file

@ -326,4 +326,31 @@ abstract class Event extends Post {
return $activitypub_object;
}
/**
* Gets the template to use to generate the content of the event.
*
* @return string The Template.
*/
protected function get_post_content_template() {
return "[ap_content]\n\n[ap_hashtags]";
// Decide: what kind of control does the user get?
// e.g. we could give the user way more control by only overriding (some) defaults like this:
/**
$type = \get_option( 'activitypub_post_content_type', 'content' );
switch ( $type ) {
case 'content':
return "[ap_content]\n\n[ap_hashtags]";
break;
default:
return parent::get_post_content_template();
break;
}
**/
}
}

View file

@ -129,13 +129,6 @@ final class GatherPress extends Event {
return $user->get_url();
}
/**
* Get the content.
*/
public function get_content(): string {
return $this->wp_object->post_content;
}
/**
* Determine whether the event is online.
*

View file

@ -127,12 +127,16 @@ final class The_Events_Calendar extends Event {
* @return string The content.
*/
protected function get_content() {
$content = parent::get_content();
// /BeforeFirstRelease:
// * remove link at the end of the content.
// * add organizer.
// * do add Cancelled reason in the content.s
// * [X] remove link at the end of the content.
// * [ ] add organizer.
// * [ ] do add Cancelled reason in the content.
// Add Organizer:
// $this->wp_object->post_content .= organizer_string;
// rest will be handled by parent::get_content().
$content = parent::get_content();
return $content;
}