The wordpress function “get_default_post_to_edit” inside the “post.php” file located at “wp-admin/includes/” is not working correctly.
When I am loading the page: wp-admin/post-new.php?post_type=product :I get an HTTP 500 error, but it does store a record inside my database, but $post_id echo’s ‘0’ (which is not 0 in the new record).
When I comment out the line below, in this function I mention above, I get no HTTP 500 error, but my page is not working correctly:
$post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
When I add the following code after the $post_id = wp_insert_post(…. it echo’s ‘NULL’:
When I try to save the product page, it tells me I don’t have the permission to do that.
Also when I try to edit an earlier posted product I can retrieve all information, but when I try to save the changes it throws me an HTTP 500 error again in the script “post.php” from this code:
$success = wp_update_post( $post_data );
How I can debug or troubleshoot wordpress in those kind of situations?
I just noticed that I can’t add, edit or delete anything using WordPress without getting an HTTP 500 Error, but it does add/edit/delete the content to the database.
All of this happend after I’ve updated WooCommerce and some other plugins and updated the data structure, I have compared my new scripts to my old scripts but I don’t see any difference.