Hi I am building a plugin and am not as familiar with wordpress hooks as I would like. The code would not be used to display on a page rather just setting in the database. I am looking for a hook or snippet that will help me do the following:
- grab all posts ids with post_type = 'post' before a certain date from current date into an array
- foreach all those in array and set each in array post_type = 'customposttype'
- do any processing that wordpress requires to clean up after this "hook". (I am not sure if this needs to be done.)
Since I am building a plugin, another plugin will not help me but I am definitely open to suggestions. Thank you!
WP_Query
+date_query
+'fields' => 'ids'
+wp_update_post()
==='solution to problem'
;-)