• I have been using the same WordPress theme for about 2 years now. Today when I tried to upload a photo I got the following message:

    Warning: Invalid argument supplied for foreach() in /home/charmcit/public_html/wp-admin/includes/image.php on line 126

    Can anyone tell me why I can no longer upload when posting? Thanks!

Viewing 1 replies (of 1 total)
  • The assumption here is that you are using WordPress Version 3.0.1.

    I don’t know why it suddenly stopped working, but you should check lines 124 to 128 of /wp-admin/includes/image.php and be sure they read exactly as follows:

    foreach ($sizes as $size => $size_data ) {
                $resized = image_make_intermediate_size( $file, $size_data['width'], $size_data['height'], $size_data['crop'] );
                if ( $resized )
                    $metadata['sizes'][$size] = $resized;
            }

    If you don’t have any way to figure out line numbers, NotePad++ is a free editor that shows line numbers. https://notepad-plus-plus.org/

    This code is part of a function that is creating information about the thumbnail that has been generated of your picture.

Viewing 1 replies (of 1 total)
  • The topic ‘Invalid Argument’ is closed to new replies.