Fatal error when creating new post
-
Hey!
I recently updated my WordPress to Version 4.9.6 and everything worked fine until a few hours ago, when I tried to upload a new post. Now I get this warning:
Fatal error: Cannot use object of type WP_Error as array in /homepages/36/d637385930/htdocs/wp-content/plugins/search-everything/search-everything.php on line 927
The post itself shows up, but every time I try to change and then update my post it just keeps loading and nothing happens.
My PHP-Code looks like this:
function se_post_publish_ping($post_id) {
//should happen only on first publish
$status = false;
if( !empty( $_POST[‘post_status’] ) && ( $_POST[‘post_status’] == ‘publish’ ) && ( $_POST[‘original_post_status’] != ‘publish’ ) ) {
$permalink = get_permalink($post_id);
$zemanta_response = se_api(array(
‘method’ => ‘zemanta.post_published_ping’,
‘current_url’ => $permalink,
‘post_url’ => $permalink,
‘post_rid’ => ”,
‘interface’ => ‘wordpress-se’,
‘deployment’ => ‘search-everything’,
‘format’ => ‘json’
));
$response = json_decode($zemanta_response[‘body’]); //this is line 927
if (isset($response->status) && !is_wp_error($zemanta_response)) {
$status = $response->status;
}
}
return $status;
}Has anyone encountered the same problem and has an idea on how to fix this?
I’m quite new to PHP, so a simple explanation would probably work best for me.Thank you already!
Best regards
- The topic ‘Fatal error when creating new post’ is closed to new replies.