Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 14 additions & 17 deletions zoninator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1086,27 +1086,24 @@ function get_single_post_in_zone( $zone, $args = array() ) {
}

function get_zones_for_post( $post_id ) {
// TODO: build this out

// get_object_terms
// get_terms

// OR

// get all meta_keys that match the prefix
// strip the prefix
$post_zones = array();

// OR
foreach($this->get_zones() as $zone) {

// get all zones and see if there's a matching meta entry
// strip the prefix from keys
foreach($this->get_zone_posts($zone) as $post) {

if($this->get_post_id($post) == $post_id) {
$post_zones[] = $zone;
break;

}

}

}

// array_map( 'absint', $zone_ids )
// $zones = array();
// foreach( $zone_ids as $zone_id ) {
// $zones[] = get_zone( $zone_id );
//}
//return $zones;
return $post_zones;
}

function get_zones( $args = array() ) {
Expand Down