0

I have the following in my error log:

[26-Mar-2019 10:40:42 UTC] PHP Warning: Illegal string offset 'content' in /home/youstable/public_html/blog/wp-content/plugins/js_composer/include/classes/editors/class-vc-frontend-editor.php on line 912

This is the code responsible for the warning:

function parseShortcodesString( $content, $is_container = false, $parent_id = false ) {
    $string = '';
    preg_match_all( '/' . self::shortcodesRegexp() . '/', trim( $content ), $found );
    WPBMap::addAllMappedShortcodes();
    add_shortcode( 'vc_container_anchor', 'vc_container_anchor' );

    if ( count( $found[2] ) === 0 ) {
        return $is_container && strlen( $content ) > 0 ? $this->parseShortcodesString( '[vc_column_text]' . $content . '[/vc_column_text]', false, $parent_id ) : $content;
    }
    foreach ( $found[2] as $index => $s ) {
        $id = md5( time() . '-' . $this->tag_index ++ );
        $content = $found[5][ $index ];
        $shortcode = array(
                'tag' => $s,
                'attrs_query' => $found[3][ $index ],
                'attrs' => shortcode_parse_atts( $found[3][ $index ] ),
                'id' => $id,
                'parent_id' => $parent_id,
        );
        if ( false !== WPBMap::getParam( $s, 'content' ) ) {
              $shortcode['attrs']['content'] = $content;  // Line 912
        }
        $this->post_shortcodes[] = rawurlencode( json_encode( $shortcode ) );
        $string .= $this->toString( $shortcode, $content );
    }

    return $string;
}

Line 912 is

$shortcode['attrs']['content'] = $content;
kalehmann
  • 4,123
  • 6
  • 18
  • 34

0 Answers0