Site icon Hip-Hop Website Design and Development

Cron: Replace 4 submit at Hour

I’ve perform that replace submit content material mechanically primarily based from customized area like this:

perform update_content(){
    $mycustomfield = get_post_meta( get_the_ID(), 'customfield', true);
    
    $submit = array();
    $submit['ID'] = get_the_ID();
    $submit['post_content' ] = $mycustomfield ;
    $submit['post_title' ] = $mycustomfield ;
    
    // Replace the submit into the database
    wp_update_post( $submit );

We replace solely customized area to make content material.
For now, we launch this perform manually on save_post hook, however the articles are so many and we want now a cron to automate this perform:

course of 4 posts each hour till all posts are accomplished, then begin over.

make this, thanks