Forums

[resolved] invalid argument supplied foreach().....wp-includes/users.php line 721 (5 posts)

  1. uorhq
    Member
    Posted 7 months ago #

    I have been having this error for about 5 days now, i have tried everything to fix it and i just can't. This error just appeared randomly and won't go away i even backed up my database, deleted all of my WordPress files then put in brand new word press files then re uploaded my database and the error came back!

    heres the section of coding with my error

    /**
     * Unserialize user metadata, fill $user object, then cache everything.
     *
     * @since 3.0.0
     * @param object $user The User object.
     * @param array $metavalues An array of objects provided by get_user_metavalues()
     */
    function _fill_single_user( &$user, &$metavalues ) {
    	global $wpdb;
    
    Line 721: foreach ( $metavalues as $meta ) {
    		$value = maybe_unserialize($meta->meta_value);
    		// Keys used as object vars cannot have dashes.
    		$key = str_replace('-', '', $meta->meta_key);
    		$user->{$key} = $value;
    	}

    Has anyone else ever had this error, can anyone help me?

  2. rickyprice
    Member
    Posted 7 months ago #

    Had something similar when changed from one theme to another. The new theme was not reading the categories from the previous content. Maybe that? Same code foreach()

  3. uorhq
    Member
    Posted 7 months ago #

    I don't believe that is my problem considering i have had my current theme for awhile

  4. uorhq
    Member
    Posted 7 months ago #

    fixed the error found out it the user id part of wproot_users in the database was missing

  5. tfraley
    Member
    Posted 6 months ago #

    uorhq,

    Im having the same issue.

    Could you elaborate how you fix'd hit..

Reply

You must log in to post.

About this Topic