history_attach_timestamp

history_attach_timestamp($node_id)

#lazy_builder callback; attaches the last read timestamp for a node.

Parameters

int $node_id: The node ID for which to attach the last read timestamp.

Return value

array $element A renderable array containing the last read timestamp.

File

core/modules/history/history.module, line 190
Records which users have read which content.

Code

function history_attach_timestamp($node_id) {
  $element = [];
  $element['#attached']['drupalSettings']['history']['lastReadTimestamps'][$node_id] = (int) history_read($node_id);
  return $element;
}
doc_Drupal
2016-10-29 09:17:42
Comments
Leave a Comment

Please login to continue.