I have some themes from WooThemes I bought about a year ago and now I'm getting around to using them. I keep getting the "illegal string offset" error. Code posted. Please advise. Thanks.
Error Messages:
Warning: Illegal string offset 'version' in C:\xampp\apps\wordpress\htdocs\wp-content\themes\flashnews\functions\admin-interface.php on line 1613
Warning: Illegal string offset 'version' in C:\xampp\apps\wordpress\htdocs\wp-content\themes\flashnews\functions\admin-interface.php on line 1659
Lines 1612 - 1659:
//Check if version is the latest - assume standard structure x.x.x
$pieces_rss = explode( '.', $latest_version_via_rss['version'] );
$pieces_local = explode( '.', $local_version );
//account for null values in second position x.2.x
if( isset( $pieces_rss[0] ) && $pieces_rss[0] != 0 ) {
if ( ! isset( $pieces_rss[1] ) )
$pieces_rss[1] = '0';
if ( ! isset( $pieces_local[1] ) )
$pieces_local[1] = '0';
//account for null values in third position x.x.3
if ( ! isset( $pieces_rss[2] ) )
$pieces_rss[2] = '0';
if ( ! isset( $pieces_local[2] ) )
$pieces_local[2] = '0';
//do the comparisons
$version_sentinel = false;
$status = 'bugfix';
// Setup update statuses
$statuses = array(
'new_version' => __( 'New Version', 'woothemes' ),
'new_feature' => __( 'New Feature', 'woothemes' ),
'bugfix' => __( 'Bugfix', 'woothemes' )
);
// New version
if ( $pieces_rss[0] > $pieces_local[0] ) {
$version_sentinel = true;
$status = 'new_version';
}
// New feature
if ( ( $pieces_rss[1] > $pieces_local[1] ) && ( $version_sentinel == false ) && ( $pieces_rss[0] == $pieces_local[0] ) ) {
$version_sentinel = true;
$status = 'new_feature';
}
// Bugfix
if ( ( $pieces_rss[2] > $pieces_local[2] ) && ( $version_sentinel == false ) && ( $pieces_rss[0] == $pieces_local[0] ) && ( $pieces_rss[1] == $pieces_local[1] ) ) {
$version_sentinel = true;
$status = 'bugfix';
}
return array( 'is_update' => $version_sentinel, 'version' => $latest_version_via_rss['version'], 'status' => $statuses[$status], 'theme_name' => $theme_name );