recursively update content
recursively update content
recursively update content
Thanks for your answers! Maybe I was a bit unclear, but I don’t use ACF, it is just a field that comes with the theme. However, this question and answers helped to find the problem: https://stackoverflow.com/questions/34018588/wordpress-add-post-meta-data-doesnt-display-on-page-until-post-is-manually My WP metadata table entry was incomplete after creating a post programatically, the theme required another field. Saving the … Read more
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
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
For a process this large you are probably running up against timeout errors. You can either set your server’s timeout to a very, very large number (not recommended) or use a different process to achieve these results. Take a look at writing a command using WP CLI or adding a scheduled task to allow the … Read more
The correct way is to use WordPress Cron and schedule your event. Also you should consider adding real cron job as outlined here for better precision. 1.) I modified your draft_the_post function to support parameter. So now we can specify which post and also i updated the portion that checking the time. 2.) dg_cron_schedule_delete_posts will … Read more
I think those articles will help you to deal with Gutenberg or WordPress v5.0 Metaboxes Adapt Your Plugin for Gutenberg Block API – Part 1 Adapt Your Plugin for Gutenberg Block API – Part 2 The Final Project Hello Gutenberg
You can display the date the post was last modified, using the Default date format setting (e.g. F j, Y) from Administration > Settings > General. Here is a code using Default date formate. <p><?php printf( __( ‘Last modified: %s’, ‘textdomain’ ), get_the_modified_date() ); ?></p>
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
I would suggest turning on error debugging. It will likely show you some PHP errors in the above code. It appears that in the meta_input array you’re calling things like update_post_meta() before the post even exists. In those functions you’re calling the $post_id variable and that also doesn’t appear to exist. On top of that, … Read more