Compare commits

...

2 commits

Author SHA1 Message Date
d3f16706f8 added generic get_content from wp_object to class-event
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 35s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Failing after 57s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Failing after 55s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Failing after 55s
2024-09-29 15:55:37 +02:00
b4d3a7efa0 changed extract_excerpt to get_excerpt 2024-09-29 15:48:01 +02:00
2 changed files with 6 additions and 3 deletions

View file

@ -126,8 +126,8 @@ abstract class Event extends Post {
* *
* @return ?string * @return ?string
*/ */
protected function extract_excerpt(): ?string { protected function get_excerpt(): ?string {
if ( $this->wp_object->excerpt ) { if ( $this->wp_object->post_excerpt ) {
return $this->wp_object->post_excerpt; return $this->wp_object->post_excerpt;
} else { } else {
return null; return null;
@ -353,4 +353,7 @@ abstract class Event extends Post {
} }
protected function get_content() {
return $this->wp_object->post_content;
}
} }

View file

@ -108,7 +108,7 @@ final class VS_Event_List extends Event_Transformer {
if ( get_post_meta( $this->wp_object->ID, 'event-summary', true ) ) { if ( get_post_meta( $this->wp_object->ID, 'event-summary', true ) ) {
return get_post_meta( $this->wp_object->ID, 'event-summary', true ); return get_post_meta( $this->wp_object->ID, 'event-summary', true );
} else { } else {
return parent::extract_excerpt(); // todo naming not uniform. return parent::get_excerpt();
} }
} }
} }