Skip to content

Commit

Permalink
flatten quiz ids array for embed domains
Browse files Browse the repository at this point in the history
  • Loading branch information
jeryj committed Jun 24, 2019
1 parent 9e1cd30 commit afed033
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ function getQuizDomainsAPI($request) {
$where = [];

// exclude dev sites by default
/*$where['embed_site_is_dev'] = '0';
$where['embed_site_is_dev'] = '0';
if(isset($request['include_dev']) && $request['include_dev']) {
unset($where['embed_site_is_dev']);
}*/
}

$dbDomains = $db->getDomains($where);

Expand Down
6 changes: 5 additions & 1 deletion includes/class-enp_embed-domain.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ protected function set_embed_domain_object_values($embed_domain_rows) {

foreach($sites as $site) {
$site_ids[] = $site->get_embed_site_id();
$quiz_ids[] = $site->get_embed_site_quiz_ids();
$site_quiz_ids = $site->get_embed_site_quiz_ids();

foreach($site_quiz_ids as $quiz_id) {
$quiz_ids[] = $quiz_id;
}
}


Expand Down

0 comments on commit afed033

Please sign in to comment.