Viewing 12 replies - 1 through 12 (of 12 total)
  • @criz666,

    Yes, this is possible, it just requires a little bit of code. Subscribe2 uses the intervals that are currently defined in WordPress (and by any plugins that create additional intervals), so all you need to do is add to the available intervals. Use code like this and simply change the interval time (in seconds) and description.

    function add_my_new_sched($sched) {
    	$sched['my_new'] = array('interval' => 2419200, 'display' => 'Four Weekly'));
    	return $sched;
    }
    add_filter('cron_schedules', 'add_my_new_sched');
    Thread Starter CriZ666

    (@criz666)

    hey, thanx a lot for your help…
    just one thing…exactly where should I add this code?
    thanx a lot

    @criz666,

    Either create your own little plugin or into the functions.php file of your active theme.

    Thread Starter CriZ666

    (@criz666)

    copied and pasted but nothing happened….hmmmmm

    @criz666,

    Whoops, syntax error as too many closing brackets. Try this:

    function add_my_new_sched($sched) {
    	$sched['my_new'] = array('interval' => 2419200, 'display' => 'Four Weekly');
    	return $sched;
    }
    add_filter('cron_schedules', 'add_my_new_sched');

    Thread Starter CriZ666

    (@criz666)

    …still nothing happen…
    I copied the code you gave me at the end of the functions.php file of my theme, but I haven’t found any change in the Subscribe2 plugin.
    Am I doing something wrong?

    @criz666,

    I suspect you must be doing something wrong as it works for me. Are you adding the code before the closing ‘?>’ of the functions.php file?

    You could try adding the code as a plugin instead if the functions.php way isn’t working.

    Thread Starter CriZ666

    (@criz666)

    whooops….that was the problem…my fault 😉
    …and if I would like to make it twice a week how do I have to modify the code?
    Thanx again for your patience

    Thread Starter CriZ666

    (@criz666)

    …I mean…if I add the same line of code but changing the secs, I have a fatal error, so I assume I have to add some code to the one you gave me…
    I have 1209600 seconds in two weeks, how can I had this schedule keeping also the four weeks?
    thanx a lot…again ;-)))

    @criz666,

    If you want to add another interval you need to make sure you change the array key name (so $sched[‘my_new2’] – note the addition of the 2) then also change the interval and description.

    Thread Starter CriZ666

    (@criz666)

    thanx a lot mate!!!!!

    Hi Matty

    I tried the below code you gave CriZ666, but it breaks the page, sorry not a php fundi.i inserted it before ?> in functions.php.

    function add_my_new_sched($sched) {
    $sched[‘my_new’] = array(‘interval’ => 2419200, ‘display’ => ‘Four Weekly’);
    return $sched;
    }
    add_filter(‘cron_schedules’, ‘add_my_new_sched’);

    Thanks

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: Subscribe2] Send emails once a week’ is closed to new replies.