WordPress.org

Ready to get started?Download WordPress

Forums

User Meta Manager
[resolved] Foreach error when editing metadata (5 posts)

  1. russtuck91
    Member
    Posted 1 year ago #

    Hello,
    I've been getting an error when I try to update any metadata (via the Edit Custom Meta button). It gives me the error: "Warning: Invalid argument supplied for foreach() in /home/aepiak/aepiak.org/wp-content/plugins/user-meta-manager/user-meta-manager.php on line 1171". I tested it a little and it seems to work fine if and only if there are inputs for Label, Classes, Additional Attributes, and HTML After.

    If you could fix this for the next update, would be greatly appreciated!

    http://wordpress.org/extend/plugins/user-meta-manager/

  2. russtuck91
    Member
    Posted 1 year ago #

    I stand corrected, it works if and only if 'Update Value for All Current Users' is checked

  3. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    This bug is fixed in version 2.0.6. Thanks for the bug report!

  4. greatdex
    Member
    Posted 10 months ago #

    could you explain why that happened? and solved?
    since i have some similar experience in my code..

  5. President McCheese
    Member
    Plugin Author

    Posted 10 months ago #

    Warning: Invalid argument supplied for foreach()

    Foreach expects the first argument to be an array.
    Example:

    $variable = "Some text";
    foreach($variable as $key => $value)

    This error indicates $variable is not an array and therefore cannot be used in a loop.
    To fix it, you must supply an array for $variable.
    Example:

    $variable = array("key1" => "Some text", "key2" => "Some text");
    foreach($variable as $key => $value)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic