For everyone who has a similar problem, try this:
-> hook to ‘save_post‘
-> write following code into the callback function $wpdb->get_var( $wpdb->prepare("UPDATE $wpdb->posts SET post_parent = %d WHERE ID = %d", $value, $post_id) );
The infinite loop was created by calling a WP-post-function. This function caused ‘save_post’-hooks to be repeatedly called who themself called the WP-post-function again. Finally the request timed out.
The solution is simple, by inserting directly with the global $wpdb class (this will not call ANY hooks!!).
Whoever is familiar with MySQL will not need any further support on this, everyone else shouldn’t try to destroy their databases and learn MySQL-statements first.
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘[Resolved] Changing post_parent by costum meta box’ is closed to new replies.