I recently upgraded my wordpress blog from PHP 7.1 to 7.2. After that, I started getting an error on the top of the pages: “Warning: Use of undefined constant”, pointing at what I previously set on wp-config.php: DISABLE_WP_CRON
I used this to disable the cron triggering with user access, instead I set up a manually cron job that runs every 20 minutes and open the wp-cron.php
The instructions I used asked to use the following format:
Turns out PHP 7.2 does not like it.
The solution to the “use of undefined constant” warning
The undefined constant error is quite generic, but in this case the fix is quite simple. Just declare like this instead:
define( ‘DISABLE_WP_CRON’, ‘true’);
I suspect some plugins might be affected by this too, but so far all the stuff I’m using is very up to date, so no issues yet!
For other topics related to WordPress or PHP, check out the PHP section on my blog.