Implements hook_entity_info().
function comment_entity_info(&$info) {
foreach (node_type_get_names() as $type => $name) {
$info['comment']['bundles']['comment_node_' . $type] = array(
'label' => t('@node_type comment', array(
'@node_type' => $name,
)),
// Provide the node type/bundle name for other modules, so it does not
// have to be extracted manually from the bundle name.
'node bundle' => $type,
'admin' => array(
// Place the Field UI paths for comments one level below the
// corresponding paths for nodes, so that they appear in the same set
// of local tasks. Note that the paths use a different placeholder name
// and thus a different menu loader callback, so that Field UI page
// callbacks get a comment bundle name from the node type in the URL.
// See comment_node_type_load() and comment_menu_alter().
'path' => 'admin/structure/types/manage/%comment_node_type/comment',
'bundle argument' => 4,
'real path' => 'admin/structure/types/manage/' . $type . '/comment',
'access arguments' => array(
'administer content types',
),
),
);
}
}