Programmatically save one/any post
Programmatically save one/any post
Programmatically save one/any post
Ah, I solved it! The problem was that outside of the admin panel WP does not load wp-admin. The solution was to add if (!is_admin()) { require_once(ABSPATH . ‘wp-admin/includes/post.php’); } Now it works like a charm! 🙂
Manual Cron job occasionally outputting WP die message
Scheduling update post daily
export a csv file from the database with a cronjob
If it’s a one-time maintenance issue then run the code manually at a time you chose. If it’s a periodic maintenance task that might be heavy, use unix cron. Otherwise, wp-cron can be used. You’re probably using it more than you know already. This plugin is great for monitoring wp-cron.
It could be the phrasing of the array so try setting the array outside the wp_schedule_event call: $args = array(‘type’=>$instance[‘type’]); wp_schedule_event(time() , ‘twicedaily’, ‘fhprw_action’,$args);
Ok, so it turns out the solution is slightly embarrassing on my part and I couldn’t see the forest for the trees. The code that was executed by the cron job was trying to check the contents of a variable that is set via a radio button on the admin / plugin activation page. Thus, … Read more
Take a look at the Transients API. It’s meant to store data temporary. Note, that this doesn’t replace a cron job, as it needs “Action” on the site. So if the site isn’t requested, where you set/alter/delete a Transient, then nothing happens.
Take a look at the docs. That plugin uses Simplepie as an aggregator. Google results: http://simplepie.org/wiki/tutorial/setting_up_a_cron_job_with_simplepie