I have a multi-purpose theme, which allow to download complete demo site content/wordpress. Normally (www.example.com) it's perfect and run all demo request, last time i install a new wordpress multisite network and enabled as Network theme.
Fatal error: Cannot use object of type WP_Error as array in /home1/user/public_html/example.com/wp-content/themes/mytheme/functions/importer/import.php on line 491
Line number 491 in import.php looks like this
if( $response['response']['code'] == 401 ){
Here is complete block of php code from line number 489 to 511
<?php
if( $test_error ){
if( $response['response']['code'] == 401 ){
// 401 Unauthorized | HTTP Basic Authentication
echo '<tr class="row-401">';
echo '<th scope="row">';
echo '<label for="import">Login details</label>';
echo '</th>';
echo '<td>';
echo '<p class="description">Looks like your server uses HTTP Basic Authentication, please enter your login details:</p>';
echo '<label for="args_login">Login</label>';
echo '<input type="text" name="args_login" />';
echo '<label for="args_pass">Password</label>';
echo '<input type="password" name="args_pass" />';
echo '</td>';
echo '</tr>';
}
}
?>
Here is details of wordpress network: Subdomains not enabled, Network Enables "beTheme", everytimes asked from support, they refer to hosting administrator and hostgator support couldn't answer about MultiSite. btw I'm sure they are not blocking any request, as i mentioned this theme works fine with normal wordpress website. I am confused what going on in Multisite Network or what should be exact solution for this? My apologies if there is already this questions asked but i couldn't find anywhere question/answer.
add_filter( 'http_api_transports', function() { return array( 'streams' ); });
in last row of wp-config.php but didn't work for me. I got error in syntax