WordPress.org

Ready to get started?Download WordPress

Forums

Error "Warning: Invalid argument supplied for foreach() (4 posts)

  1. funsail
    Member
    Posted 1 year ago #

    I got a multisite.
    When I make a new site, then go to dashboard, I get

    "Warning: Invalid argument supplied for foreach() in /home/user/public_html/wp-includes/query.php on line 1702"

    the line is
    foreach ( $GLOBALS['wp_taxonomies'] as $taxonomy => $t ) {

    I tried to add
    echo $GLOBALS['wp_taxonomies'];

    but it doesnt print anything

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Can you wrap the foreach with

    if ( is_array( $GLOBAL['wp-taxonomies'] )
  3. funsail
    Member
    Posted 1 year ago #

    Yes that gets rid of the error.
    I'm worried about the cause. Is my DB corrupt?

    This site was copied from my other host, files all copied, import DB, and edited DB for domain names. So I wonder why it gets this error when the old one is fine.

  4. Reinstall the WP core files. It's more likely one of them got bunged.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.