Ultimate Category Excluder
PHP error (3 posts)

  1. djeyewater
    Posted 3 years ago #


    I got this notice in my error logs:
    PHP Notice: Undefined variable: array2 in /wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 127
    To fix, Ln 104 add:


  2. Michael Clark
    Plugin Author

    Posted 3 years ago #

    Hi, thanks for that bug report. I'm looking into it, trying to reproduce it. What version of WP, PHP, MySQL are you using? You can email me directly if you don't want to post that info publicly. Mike

  3. djeyewater
    Posted 3 years ago #

    Hi Mike

    You can see the error if you have error reporting turned on. in my wp-config.php I have:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

    (I'm actually trying to debug a problem with wp-cron not working, but it is difficult when the error logs are full of errors from unrelated things).

    If you look at the function ksuce_exclude_categories (line 102 in ultimate-category-excluder.php) you'll see that you're trying to add an item to the array $array2.
    $array2[$mbccount] = $value;
    But $array2 is not declared in the function, so PHP throws this Notice. It is a notice, not a critical error.

    It can be fixed by declaring $array2 as an array at the start of the function (the fix I put in my previous post).



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Ultimate Category Excluder
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.