Home wp_cronjob should run a special function
 I am creating a new wordpress plugins and I want to use the cronjob system from wordpress. But I get a little bit confused: Everytime the cronjob gets executed I want to run a special function. But the action will not be done. No post will be inserted. The cronjob itselfs works correct. Maybe I do something wrong. (I manually tested the cron by opening the url wp-cron.php?immo_import_check_import_folders, and it shows me blank page. (Seems this is normal) Code: register_activation_hook(__FILE__, 'immo_import_activation'); register_deactivation_hook(__FILE__, 'immo_import_deactivation'); function immo_import_activation() { wp_schedule_event( time(), 'minutely', 'immo_import_check_import_folders' ); add_action( 'immo_import_check_import_folders', 'immo_import_check_import_folders2' ); } function immo_import_deactivation() { wp_clear_scheduled_hook('immo_import_check_import_folders'); } function immo_import_check_import_folders2() { $my_post = array( 'post_title' => wp_strip_all_tags( 'Test' ), 'post_content' => 'test .......', 'post_status' => 'publish', 'post_author' => 1, 'post_category' => array( 8,39 ) ); wp_insert_post($my_post); }