Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Fix #257 , Fix #247
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Dec 12, 2017
1 parent 01bc5b2 commit 9eaf0ca
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/Hyyan/WPI/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,23 @@ public function translateShopUrl($url, $language) {
* @return string modified form
*/
public function addShortcodeLanguageFilter($query_args, $atts) {

$ids = explode(',', $atts['ids']);
$transIds = array();
foreach ($ids as $id) {
array_push($transIds, pll_get_post($id));
}

$atts['ids'] = $transIds;
$query_args['post__in'] = $transIds;

if (strlen($atts['ids'])) {

$ids = explode(',', $atts['ids']);
$transIds = array();
foreach ($ids as $id) {
array_push($transIds, pll_get_post($id));
}

$atts['ids'] = implode($transIds, ',');
$query_args['post__in'] = $transIds;
} else {
$query_args['lang'] = isset($query_args['lang']) ?
$query_args['lang'] : pll_current_language();
}

return $query_args;
}

Expand Down

0 comments on commit 9eaf0ca

Please sign in to comment.