How to pass custom field types and taxonomies to the WordPress plugin?

Yes. You can customize the discourse_publish_format_html template for a specific post type. See this topic for more details about customizing the templates: Customize the structure of WP Discourse templates

Something like this, added to a plugin, or to your theme’s functions.php file should work. You can use the following tags in the template: {excerpt}, {blogurl}, {author}, {thumbnail}, {featuredimage}


add_filter( 'discourse_publish_format_html', 'wpdc_custom_discourse_publish_format_html' );
function wpdc_custom_discourse_publish_format_html( $output ) {
    global $post;
    if ( 'your_custom_type' === $post->post_type ) {
        // Get the custom fields and taxonomies that you want published from your post, then...
	    ob_start();
	    ?>
        Originally published at: {blogurl}<br><br>
        {excerpt}

	    <?php
	    $output = ob_get_clean();
    }

    return $output;
}
4 Likes