Is there docs, or API info on what the extend() should take?

What are the default values for the extend()?

function extend($blog_id, $extend, $gateway = false, $level = 1, $amount = false, $expires = false)

I am attempting to programmatically add a site to Pro Sites via another function, it is working but not sure I am getting values correct.

1. Is $extend just a time frame?

2. What is $gateway?

3. Can $level be a variable passed in via $meta array?

4. What is $amount for? Why false by default?

5. What is $expires for? I set it to true thinking that meant trial but no…

  • Aaron
    • CTO

    1. Is $extend just a time frame?

    1,3,12 for months, or an arbitrary amount of seconds to extend.

    2. What is $gateway?

    Just a string name of the gateway for info purposes, not required.

    3. Can $level be a variable passed in via $meta array?

    It doesn’t matter how you pass it, as long as it’s an integer 1-or more. What level you want to give them. If you change this it will trigger upgrade/downgrade scripts.

    4. What is $amount for? Why false by default?

    It’s optional. Though in many gateways it is used to calculate a prorated upgrade price.

    5. What is $expires for? I set it to true thinking that meant trial but no…

    It’s an override for $extend, allowing you to pass an actual timestamp to extend too. This one is in flux and not used at the moment.

  • Ryan
    • Design Lord, Child of Thor

    Excellent, thank you much, very helpful!

    Any idea why this code block is giving a 14 day trial instead of 7? It appears to be adding to the trial length set in Pro Sites settings maybe?

    $extend = 7 * 86400;
    $level = $meta['level_choice'];
    $p = new ProSites();
    $p->extend($blog_id, $extend, 'Trial', $level);

    Secondly, is there a way to override the ‘Trial Notice’ that goes on top of admin area? It is defaulting to say the level that is set for trials in settings, and not the level that is chosen and passed in here, does that make sense?

    Thank you again.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.