Last active
November 3, 2015 19:59
-
-
Save timkelty/8162670107f0e44bba1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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