function rdf_comment_load

Implements hook_comment_load().

File

drupal/core/modules/rdf/rdf.module, line 414
Enables semantically enriched output for Drupal sites in the form of RDFa.

Code

function rdf_comment_load($comments) {
  foreach ($comments as $comment) {

    // Pages with many comments can show poor performance. This information
    // isn't needed until rdf_preprocess_comment() is called, but set it here
    // to optimize performance for websites that implement an entity cache.
    $comment->rdf_data['date'] = rdf_rdfa_attributes($comment->rdf_mapping['created'], $comment->created->value);
    $comment->rdf_data['nid_uri'] = url('node/' . $comment->nid->target_id);
    if ($comment->pid->target_id) {
      $comment->rdf_data['pid_uri'] = url('comment/' . $comment->pid->target_id);
    }
  }
}