Auto-update posts in WordPress with Magic Fields

Im trying to update all my posts at once on WordPress, instead of painfully going on each page and Updating it.
I made a small plugin using the wp_update_post, but it didnt recognize and update the Magic Fields postmeta. I then tried to include SaveCustomFields from the RCCWP_POST from Magic Fields, however it requires $_POST information to work.
I am open to any suggestion, i tried a few SQL queries to accomplish this with no success.

It would look like that:

function activate()
{
    $my_posts = get_posts( array('post_type' => 'post', 'numberposts' => -1 ) );
    foreach ( $my_posts as $my_post )
    {
        wp_update_post( $my_post );
        RCCWP_Post::SaveCustomFields($my_post->ID);
    }
}

Read more here: Auto-update posts in WordPress with Magic Fields

Leave a Reply

Your email address will not be published. Required fields are marked *