• Resolved _Sascha_

    (@_sascha_)


    Got an undefined offset on Line 100. Looked into it without indexes and got only just “Undefiniert” (what is german for “undefined”). So it can’t be the real undefined and was an value.

    I decided to check if the first offset is set and if not, that the $attr should accessed without the offsets.

    add_filter('wp_get_attachment_image_src', 'hm_replace_image_get_attachment_image_src');
    function hm_replace_image_get_attachment_image_src($attr) {
    	if (is_admin()) {
            if(isset($attr[0])) $attr[0] .= (strpos($attr[0], '?') === false ? '?' : '&').'_t='.time(); else
                                $attr    .= (strpos($attr   , '?') === false ? '?' : '&').'_t='.time();
    	}
    	return $attr;
    }

    https://wordpress.org/plugins/replace-image/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Undefined Index (0) on Line 100 (mainfile)’ is closed to new replies.