transformer_refactoring #44

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

View file

@ -126,7 +126,7 @@ abstract class Event extends Post {
*
* @return ?string
*/
protected function extract_excerpt(): ?string {
protected function retrieve_excerpt(): ?string {
if ( $this->wp_object->post_excerpt ) {
return $this->wp_object->post_excerpt;
} else {
@ -232,7 +232,7 @@ abstract class Event extends Post {
*/
public function get_summary(): ?string {
add_filter( 'activitypub_object_content_template', array( self::class, 'remove_ap_permalink_from_template' ), 2, 2 );
$excerpt = $this->extract_excerpt();
$excerpt = $this->retrieve_excerpt();
// BeforeFirstRelease: decide whether this should be a admin setting.
$fallback_to_content = true;
if ( is_null( $excerpt ) && $fallback_to_content ) {

View file

@ -104,11 +104,11 @@ final class VS_Event_List extends Event_Transformer {
*
* @return ?string
*/
protected function extract_excerpt(): ?string {
protected function retrieve_excerpt(): ?string {
if ( get_post_meta( $this->wp_object->ID, 'event-summary', true ) ) {
return get_post_meta( $this->wp_object->ID, 'event-summary', true );
} else {
return parent::extract_excerpt();
return parent::retrieve_excerpt();
}
}
}