Created
November 5, 2014 06:24
-
-
Save traversal/6a13e7786d168d7588db to your computer and use it in GitHub Desktop.
Dedupe Workaround
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
<?php | |
// -- in functions.php | |
// --- Suppose you want to dedupe by a "first_name" field in a "bio" set | |
class MY_Post extends MEOW_Post { | |
function bio_firstname() { | |
return $this->bio->first_name(); | |
} | |
} | |
// --- Now in you template code you should be able to do this: | |
// -- assumes you have a post type named person | |
foreach ($wf->type("person")->posts->dedupe("bio_firstname") as $person) { | |
// do something here | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment