grappler / polylang-slug

A unique post slug within the language in Polylang. This allows for a page to have same/identical slug in multiple languages.
268 stars 84 forks source link

Undefined index notices #16

Closed swissspidy closed 8 years ago

swissspidy commented 8 years ago

Hey there

After f50cc365c70260f7ebdf73f2f5278ba662870a47 we got some undefined index notices on line 220.

//if the current language is not the default, lets pick up the default language post
if ($defLang != $curLang)
    $filterPostIDs[] = $transPost[$defLang];

In this case, $transPost[$defLang]; might not be set. I guess a simple isset or array_key_exists check would suffice.

Only happens when on a translated post or a translated 404 page.

grappler commented 8 years ago

Sorry that code should not have been there. I have removed it now.