Compatibility WordPress 5.8.1
-
Hey!
I need to sync the post between two websites, but after following the instructions and setting up the plugin I received an error message while updating the post I would like to sync.This was the error message I received:
[06-Oct-2021 14:55:02 UTC] PHP Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in /public_html/wp-content/plugins/sync-post-with-other-site/includes/sps_sync.class.php:122 Stack trace: #0 /public_html/wp-includes/class-wp-hook.php(303): SPS_Sync->sps_save_post() #1 /public_html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters() #2 /public_html/wp-includes/plugin.php(470): WP_Hook->do_action() #3 /public_html/wp-includes/post.php(4468): do_action() #4 /public_html/wp-includes/post.php(4570): wp_insert_post() #5 /public_html/wp-admin/includes/post.php(423): wp_update_post() #6 /public_html/wp-admin/post.php(227): edit_post() #7 {main} thrown in /public_html/wp-content/plugins/sync-post-with-other-site/includes/sps_sync.class.php on line 122I solved this error message by wrapping the problem code in a if statement, like this:
$response = $this->sps_send_data_to( 'add_update_post', $args, $sps_website ); if (!is_wp_error($response)) { if( isset( $response['response']['code'] ) && $response['response']['code'] == 200 ) { $other_site_post_id = $response['body']; } }But afterwards I was just able to update my post but it wouldn’t sync with the other website, and it wouldn’t remember the website checkbox I checked on the page.
I also tested the functionality with all the plugins turned off except for the “Sync Post With Other Site” plugin and I still hadn’t any succes.
Could you please help me out with my problem?
Thanks in advance! 😀
The topic ‘Compatibility WordPress 5.8.1’ is closed to new replies.