Revert "improved readability of get_summary by using ternary operator"
Some checks failed
PHP Code Checker / PHP Code Checker (pull_request) Failing after 32s
PHPUnit / PHPUnit – PHP 8.1 (pull_request) Successful in 1m1s
PHPUnit / PHPUnit – PHP 8.2 (pull_request) Successful in 58s
PHPUnit / PHPUnit – PHP 8.3 (pull_request) Successful in 58s

This reverts commit 7c9424526d.
This commit is contained in:
ruru4143 2024-09-29 14:04:07 +02:00
parent 7d979a1c5e
commit 228dba06ae

View file

@ -138,9 +138,13 @@ final class GatherPress extends Event {
* @return string $summary The custom event summary. * @return string $summary The custom event summary.
*/ */
public function get_summary(): string { public function get_summary(): string {
$excerpt = $this->wp_object->post_excerpt if ( $this->wp_object->excerpt ) {
?: get_post_meta( $this->wp_object->ID, 'event-summary', true ) $excerpt = $this->wp_object->post_excerpt;
?: $this->get_content(); } elseif ( get_post_meta( $this->wp_object->ID, 'event-summary', true ) ) {
$excerpt = get_post_meta( $this->wp_object->ID, 'event-summary', true );
} else {
$excerpt = $this->get_content();
}
$address = get_post_meta( $this->wp_object->ID, 'event-location', true ); $address = get_post_meta( $this->wp_object->ID, 'event-location', true );
$start_time = get_post_meta( $this->wp_object->ID, 'event-start-date', true ); $start_time = get_post_meta( $this->wp_object->ID, 'event-start-date', true );