Support » Plugin: User Specific Content » .Error Warning: count() on line 373

  • privatecontenterror

    (@privatecontenterror)


    .this message appeared on every page of my site since yesterday afternoon.

    Warning: count(): Parameter must be an array or an object that implements Countable in /home/xxxxxxxx/public_html/xxxxxxxx/wp-content/plugins/user-specific-content/User-Specific-Content.php on line 373

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter privatecontenterror

    (@privatecontenterror)

    12 month old answer might be obsolete please confirm

    miss-d

    (@miss-d)

    12 months ago

    …can someone test this code? It seems to work for me:

    wp-content/plugins/user-specific-content/User-Specific-Content.php – Line 373

    change:
    if (!count($savedusers) > 0 && !count($savedroles) > 0 ){

    to:
    if (!$savedusers > 0 && !$savedroles > 0 ){

    Also having this same issue, but ours is located at

    /home/XXXXXXX/public_html/wp-content/themes/XXXXX/wpalchemy/MetaBox.php on line 2126.

    I managed to get it off of one page by switching the code from this
    $cnt = count(!empty($this->meta[$n])?$this->meta[$n]:NULL);
    to:
    $cnt = (!empty($this->meta[$n]))? count($this->meta[$n]):0;

    This article helped me find that >> https://wordpress.org/support/topic/misuse-of-count-function-in-metabox-php/

    But, we still having issues on other pages. Not sure how to fix it.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘.Error Warning: count() on line 373’ is closed to new replies.