Resource functions
Collection functions
Search functions
IIIF
Metadata functions
User functions
System
Message functions
Plugin functions

get_resource_comments

Retrieve comments for the specified resource reference. 

* Available from version 11.0.

Variable Description Data type
$resource_ref * Resource ID integer
$flat_view
Return in order of creation, newest first. By default false to use tree view. bool

Return values

Array of comments will be returned in tree view layout by default. Top level comments will appear first with comments at lower levels displayed most recent first while respecting hierarchy of responses. It is also possible to request the comments as a flat list ordered most recent first. In most cases, using the same layout as system config $comments_flat_view is recommended.

An empty array maybe returned if the user doesn't have permission to view the resource or resource commenting is disabled in the system.