Skip to content

Instantly share code, notes, and snippets.

@timkelty
Last active November 3, 2015 19:59
Show Gist options
  • Save timkelty/8162670107f0e44bba1e to your computer and use it in GitHub Desktop.
Save timkelty/8162670107f0e44bba1e 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