• Resolved brk983

    (@brk983)


    I find two versions all over the web, which one is correct?

    define('DISABLE_WP_CRON', 'true');

    or

    define('DISABLE_WP_CRON', true);

    Or does it even matter?

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Clayton James

    (@claytonjames)

    The info as presented directly from the Codex: https://codex.ww.wp.xz.cn/Editing_wp-config.php#Alternative_Cron

    Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    In PHP, it actually doesn’t matter. Due to PHP’s type juggling, “true” == true. Oddly enough, the string “false” also equals a boolean true, so be careful with that.

    Your second example is more correct and less error prone.

    Thread Starter brk983

    (@brk983)

    “true” is yet a third option… are you saying that works too? I have seen only

    define('DISABLE_WP_CRON', 'true');

    or

    define('DISABLE_WP_CRON', true);

    but not

    define('DISABLE_WP_CRON', "true");

    Thanks.

    Moderator Samuel Wood (Otto)

    (@otto42)

    ww.wp.xz.cn Admin

    In PHP, all of those are really identical.

    The most correct is this one: define('DISABLE_WP_CRON', true);

    PHP is a loosely typed language. Please read that link I posted earlier about type juggling to understand how it works.

    Thread Starter brk983

    (@brk983)

    Thanks for the clarification.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Disabling wp-cron, which is correct?’ is closed to new replies.