removed link at get_content() for all event
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 36s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 1m0s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 55s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 57s

This commit is contained in:
ruru4143 2024-09-29 15:45:53 +02:00
parent 5fa3876c1a
commit 4f61a1c97e
3 changed files with 35 additions and 11 deletions

View file

@ -326,4 +326,31 @@ abstract class Event extends Post {
return $activitypub_object; 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(); return $user->get_url();
} }
/**
* Get the content.
*/
public function get_content(): string {
return $this->wp_object->post_content;
}
/** /**
* Determine whether the event is online. * Determine whether the event is online.
* *

View file

@ -127,12 +127,16 @@ final class The_Events_Calendar extends Event {
* @return string The content. * @return string The content.
*/ */
protected function get_content() { protected function get_content() {
$content = parent::get_content();
// /BeforeFirstRelease: // /BeforeFirstRelease:
// * remove link at the end of the content. // * [X] remove link at the end of the content.
// * add organizer. // * [ ] add organizer.
// * do add Cancelled reason in the content.s // * [ ] 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; return $content;
} }