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

Commit

Permalink
Fixed issue #43 & Fixed issue #44
Browse files Browse the repository at this point in the history
  • Loading branch information
hyyan committed Jul 30, 2016
1 parent d831b6c commit 8d38752
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Hyyan/WPI/Endpoints.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ public function correctPolylangSwitcherLinks($link, $slug)
public function fixMyAccountLinkInMenus(array $items = array())
{
global $polylang;
$translations = $polylang->model->get_translations(
'post', wc_get_page_id('myaccount')
$translations = PLL()->model->post->get_translations(
wc_get_page_id('myaccount')
);

foreach ($items as $item) {
Expand Down
6 changes: 3 additions & 3 deletions src/Hyyan/WPI/Pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function getPostTranslationID($id)
if (!function_exists('pll_get_post')) {
return $id;
}

$translatedID = pll_get_post($id);

if ($translatedID) {
Expand All @@ -93,8 +93,8 @@ public function correctShopPage(\WP $wp)
$shopID = wc_get_page_id('shop');
$shopOnFront = ('page' === get_option('show_on_front')) && in_array(
get_option('page_on_front')
, $polylang->model->get_translations(
'post', $shopID
, PLL()->model->post->get_translations(
$shopID
));

$vars = array('pagename', 'page', 'name');
Expand Down
4 changes: 2 additions & 2 deletions src/Hyyan/WPI/Utilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ final class Utilities
public static function getProductTranslationsArrayByID($ID, $excludeDefault = false)
{
global $polylang;
$IDS = $polylang->model->get_translations('post', $ID);
$IDS = PLL()->model->post->get_translations($ID);
if (true === $excludeDefault) {
unset($IDS[pll_default_language()]);
}
Expand Down Expand Up @@ -135,7 +135,7 @@ public static function getLanguageEntity($slug)
public static function getTermTranslationsArrayByID($ID, $excludeDefault = false)
{
global $polylang;
$IDS = $polylang->model->get_translations('term', $ID);
$IDS = PLL()->model->term->get_translations($ID);
if (true === $excludeDefault) {
unset($IDS[pll_default_language()]);
}
Expand Down

0 comments on commit 8d38752

Please sign in to comment.