Title: PHP statement for cron job post type switch
Last modified: October 20, 2022

---

# PHP statement for cron job post type switch

 *  [mattivoltarii](https://wordpress.org/support/users/mattivoltarii/)
 * (@mattivoltarii)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/php-statement-for-cron-job-post-type-switch/)
 * Hi, thank you for the great plugin!
 * I would like to create a cron job with PHP in which post types are switched. 
   Do you have an example for me how that would look like in PHP?
 * For example something like that:
 * require_once(ABSPATH . ‘wp-content/plugins/post-type-switcher/post-type-switcher.
   php’);
    $post_ID =223; $post_type =’archive’; set_post_type( $post_id, $post_type);
 * Thanks!

The topic ‘PHP statement for cron job post type switch’ is closed to new replies.

 * ![](https://ps.w.org/post-type-switcher/assets/icon-256x256.jpg?rev=1823578)
 * [Post Type Switcher](https://wordpress.org/plugins/post-type-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-type-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-type-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/post-type-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-type-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-type-switcher/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mattivoltarii](https://wordpress.org/support/users/mattivoltarii/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/php-statement-for-cron-job-post-type-switch/)
 * Status: not resolved