Created
September 15, 2016 16:03
-
-
Save EranSch/a00fb17210c39923e6df9a18da4285b4 to your computer and use it in GitHub Desktop.
hack
This file contains hidden or 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
$cat_counts = (new F\MaybeEmpty($full_query->get_posts())) | |
->bind($posts ==> array_map($p ==> wp_get_post_categories($p->ID), $posts)) | |
->bind('tft\fp\flatten') | |
->bind($cats ==> F\reduce($cats, function($carry, $id) { | |
$carry[$id]++; | |
return $carry; | |
}), []) | |
->extract(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment