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.
275 stars 84 forks source link

Call to undefined function PLL() in polylang-slug.php on line 71 #20

Closed Paronomasiaster closed 8 years ago

Paronomasiaster commented 8 years ago

Hi there.

First and foremost, I should make clear that I am a complete noob. I've recently started making my first website, and am learning as I go.

Anyway, I came across your plugin while researching ways to get the same slug for the two languages (Japanese (default) and English) on my site, e.g. abcdef.co.jp/contact for Japanese, and abcdef.co.jp/en/contact for English. Before, it kept auto-changing it to .../en/contact-2, since the Japanese page was already called /contact. After (seemingly successfully) installing your plugin, when I try to change the English slug to contact, it comes up with a fatal error saying:

Call to undefined function PLL() in polylang-slug.php on line 71

Line 71 would appear to be the middle of these three:

// Get language of a post $lang = PLL()->model->post->get_language( $post_ID ); $options = get_option( 'polylang' );

None of this code means anything to me, so I wonder if you can shed any light on this for me so I can get it working? It would be much appreciated.

Many thanks.

Paronomasiaster commented 8 years ago

Actually, I have got it working. I realised that you updated the plugin for Polylang v1.8 a few days ago. I am using v1.7, so I installed the previous version of your plugin which seems to be working fine. Don't know if there's still an issue with the code in the new version, or if it's just because I was using v1.7 as opposed to v1.8

grappler commented 8 years ago

I updated the plugin to work in Polylang v1.8 but this way loosing compatibility with v1.7. You should have gotten a message that you need to use Polylang v1.8. I will have a look at it.

Thank you for reporting this :smile:

grappler commented 8 years ago

Hey, I have made a few more changes making the current version again compatable with Polylang 1.7.

https://github.com/grappler/polylang-slug/archive/master.zip