Skip to content

Correcting an illegal string offset error in Thesis

Some clients have been reporting an error when trying to update or create a new post with sites using an older Thesis framework. (1.8x) This can happen on servers that have upgraded their php. Newer versions of PHP (correctly) throw an error when the [‘type’] field contains a value instead of an array.

The error is something like this:

Warning: Illegal string offset 'type' in /wp-content/themes/thesis/lib/admin/options_post .php on line 150

The Fix

Option 1: You can upgrade Thesis to the latest 1.8x or you can change the offending code manually.

Option 2: Changing the offending line 150 from:

if (($meta_field['type']['type'] == 'checkbox') && is_array($meta_field['type']['options'])) {

to:

if ((is_array($meta_field['type'])) && ($meta_field['type']['type'] == 'checkbox') && is_array($meta_field['type']['options'])) {

Posted in

Lena Shore

Lena is a full-time freelancer and nerd that specializes in web development, graphic design, and illustration. She enjoys building things, learning new things, pursuing creative endeavors, and giving free advice.

1 Comment

  1. Paolo on October 11, 2014 at 4:45 pm

    thanks a lot! this saved me time debugging my site 🙂

Leave a Comment





This site uses Akismet to reduce spam. Learn how your comment data is processed.

Archives