Post Expirator
[resolved] Multiple call to _scheduleExpiratorEvent causes constant error (2 posts)

  1. Bas Schuiling
    Posted 2 years ago #

    I'm using a script that calls multiple times ( I have an array of posts-ID's to schedule ) to _scheduleExpiratorEvent. However by the way of defining postExpiratorDebug which is called starting the function every next iteration leads to a 'Notice: Constant is already defined' error.

    Below I'm just returning when the constant is already set which leaves me no further errors ( but I can image it can be done a bit more solid than this ).

    function postExpiratorDebug() {
    	$debug = get_option('expirationdateDebug');
    if (defined("POSTEXPIRATOR_DEBUG")) return; // <-- my addition
    	if ($debug == 1) {
                    require_once(plugin_dir_path(__FILE__).'post-expirator-debug.php'); // Load Class
                    return new postExpiratorDebug();
    	} else {
    		return false;

    It's no biggie but maybe some small improvement for next version :)


  2. Aaron Axelsen
    Plugin Author

    Posted 2 years ago #

    I've made some adjustments in the development version that will be in the next release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Post Expirator
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic