Skip to content

Instantly share code, notes, and snippets.

@steverowling
Forked from timkelty/CustomPlugin.php
Created November 3, 2015 19:59
Show Gist options
  • Save steverowling/05bc85c57f58396d718f to your computer and use it in GitHub Desktop.
Save steverowling/05bc85c57f58396d718f to your computer and use it in GitHub Desktop.
public function modifyEntrySources(&$sources, $context)
{
if ($context === 'index') {
foreach ($sources as &$source) {
if (!isset($source['label'])) {
continue;
}
$total = craft()->elements->getTotalElements($source['criteria']);
$source['label'] .= ' ('. $total .')';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment