Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command to set the license for polylang pro #113

Open
mvanmeerbeck opened this issue Oct 30, 2017 · 3 comments
Open

Command to set the license for polylang pro #113

mvanmeerbeck opened this issue Oct 30, 2017 · 3 comments

Comments

@mvanmeerbeck
Copy link

Hi,

I'm using the pro version of polylang and i'm willing to set the license through the wp-cli but the option doesn't appear after:

wp pll option list

In fact, this option is under another namespace
wp option list | grep license

polylang_licenses

Is there anyway to handle that ?

Thanks!

@diggy
Copy link
Owner

diggy commented Oct 31, 2017

sure, any suggestions as to implementation?

@tditlu
Copy link

tditlu commented Jun 4, 2018

@diggy: I also had a problem with this, solved it by calling activate_license, if $licenses['polylang-pro']['key'] was not set:

if (defined('POLYLANG_PRO') && defined('POLYLANG_PRO_LICENSE_KEY') && !empty(POLYLANG_PRO_LICENSE_KEY)) {
    add_action('after_setup_theme', function() {
        $licenses = get_option('polylang_licenses');
        if (empty($licenses['polylang-pro']['key'])) {
            $license = new PLL_License(POLYLANG_FILE, 'Polylang Pro', POLYLANG_VERSION, 'Frédéric Demarle');
            $license->activate_license(POLYLANG_PRO_LICENSE_KEY);
        }
    });
}

In my wp-config.php i then have this define:

define('POLYLANG_PRO_LICENSE_KEY', 'xxxxxxxxxxxxxxxx');

Something similar could be implemented in polylang-cli...

@diggy
Copy link
Owner

diggy commented Jun 15, 2018

@tditlu I'm not a PLL pro user, so I'm not sure if I'm in the best position to implement this. Of course, I welcome a PR that fixes your problem :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants