PHP Предупреждение: недопустимое смещение строки в Wordpress : There is a warning:
Warning: Illegal string offset 'alt' in /home/procsi/galina3000.ru/wp-content/themes/memoir/epanel/custom_functions.php on line 112

Warning: Illegal string offset 'title' in /home/procsi/galina3000.ru/wp-content/themes/memoir/epanel/custom_functions.php on line 113

The code is shown below:



    if ( function_exists('has_post_thumbnail') ) {
    		if ( has_post_thumbnail( $post->ID ) ) {
    			$thumb_array['use_timthumb'] = false;
    			
    			$args='';
    			if ($class <> '') $args['class'] = $class;
    			if ($alttext <> '') $args['alt'] = $alttext;
    			if ($titletext <> '') $args['title'] = $titletext;
    			
    			$thumb_array['thumb'] = get_the_post_thumbnail( $post->ID, array($width,$height), $args );
    			
    			if ($fullpath) {
    				$thumb_array['fullpath'] = get_the_post_thumbnail( $post->ID );
    				if ($thumb_array['fullpath'] <> '') { 
    					$thumb_array['fullpath'] = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $thumb_array['fullpath'], $matches);
    					$thumb_array['fullpath'] = trim($matches[1][0]);
    				}
    			}
    		}

How to fix it? Thank you.


