How to update the children of a post?

get_children returns an array of post objects by default: https://developer.wordpress.org/reference/functions/get_children/ So you would have to use ‘ID’ => $child->ID, in this case… also my want to wrap the foreach with if (count($children) > 0) {} to prevent possible errors where there are no children. ie: $children = get_children( $mainid ); if (count($children) > 0) { … Read more

Update around 200,000 posts

You mentioned setting the memory limits and execution time to unlimited, so this may not be the right answer. I thought I’d mention it anyway since it may help. Since you have so much content, you’ll have to find ways to accomplish this in the background rather than during the request. This is the perfect … Read more

Change the term based on the value of a $variable using wp_update_post in submitting a form

Your problem is this line: if (isset($_POST[‘call_16’]) == ‘No’ ) { isset() returns true or false based on whether the ‘call_16′ item exists in the $_POST array. It doesn’t return the value. So isset($_POST[‘call_16’]) is true, not ‘No’. If you want to check if it’s set and that it has a specific value (which you … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)