WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate Category Excluder
PHP error (3 posts)

  1. djeyewater
    Member
    Posted 1 year ago #

    Hi

    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:
    $array2=array();

    http://wordpress.org/extend/plugins/ultimate-category-excluder/

  2. Michael Clark
    Member
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year 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);
    ini_set('display_errors',0);

    (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).

    Cheers

    Dave

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.