- Is this the correct code if I want to allow writing standard WordPress comments on the request page?
- And how to include another file with the comments template instead of the standard comments.php?
add_filter( 'hivepress/v1/post_types', 'comment_request_page' );
function comment_request_page ( $post_types ) {
$post_types['request']['supports'][] = 'comments';
return $post_types;
}
add_filter( 'hivepress/v1/templates/request_view_page', 'comment_request_page_two' );
function comment_request_page_two ( $template ) {
return hivepress()->helper->merge_trees(
$template,
[
'blocks' => [
'page_content' => [
'blocks' => [
'request_comments' => [
'type' => 'callback',
'callback' => 'comments_template',
'_order' => 110,
],
],
],
],
]
);
}