ACF Relationship-Feld in discourse_publish_format_html

Für alle, die ein ACF-Beziehungsfeld erweitern möchten: Hier ist die Lösung, die schließlich funktioniert hat, wenn der CPT, den ich an Discourse sende, memes heißt und ein Beziehungsfeld (als Objekt) namens meme_person enthält, das auf einen anderen CPT namens people verweist.

function rs_custom_publish_format_html( $output, $post_id ) {

	$post = get_post( $post_id );
	$type = get_post_type($post_id);
	
	// Wenn ein Beitragsbild vorhanden ist, verwende es
	if ( has_post_thumbnail( $post_id ) ) {
		$image = "{thumbnail}<br><br>";
	} else {
		$image = "";
	}

    // Wenn der Beitrag ein Meme ist, hole die benutzerdefinierten Feldinformationen
    if ( 'memes' === $post->post_type) {
    	$comment = get_post_meta($post->ID, 'comment', true);
		$peopleout = ' ';

		$persons = get_post_meta($post->ID, 'meme_person', true);
		if( $persons ):
			foreach( $persons as $person ):
		        $title = get_the_title($person);
				$peopleout .= $title . ' ' ;
			endforeach;
		endif; ?>

        <?php ob_start(); ?>
  
        <small>Ursprünglich veröffentlicht auf: {blogurl}</small><br><br>
        <?php echo $image ?>
        <?php echo $comment ?><br>
        <?php echo $peopleout ?>

        {excerpt}
	  
        <?php 
        $output = ob_get_clean();
        
        return $output;
    }
  
      
    // Andernfalls zurückgeben
    ob_start();
    the_permalink( $post_id );
	$output = ob_get_clean();
	return $output;
    
}
add_filter( 'discourse_publish_format_html', 'rs_custom_publish_format_html', 10, 2  );