Delete posts from a post type automatically via Cron
how can I use Cron to delete posts of a certain post type once they reach a certain limit, like keep maximum 50 posts?
how can I use Cron to delete posts of a certain post type once they reach a certain limit, like keep maximum 50 posts?
I have a WordPress function that I want to run once daily at a specific time. How should I go about doing this, since WP cron cannot be set to a particular time?
I have to run a PHP script through real cron (WP cron being too unreliable). Within that script, I need $wpdb to insert data into WordPress table. But of course $wpdb will not be available as WordPress would not be initialized. Right? So, my question is how to ‘include’ WordPress/initialize WordPress environment to do such tasks? How about
require_once(“wp-load.php”)?
I have a custom php loop/function written that works in the following way
This is kind of a stupid question…
I’m working on an email system and they want it automated to send out emails every second thursday of the month. I’ve got the PHP sorted out and ready to fire a callback to send the emails, but I’m a complete newbie when it comes to cron and scheduling events.
Is there a recommended way to log (failed) cron actions from your plugin? For example, I have a plugin that synchronizes with an external service every hour. I want to log how much was changed, but also when the synchronization failed. What would you recommend here? A new database table? The Log Deprecated Notices plugin does this with a custom post type, but this might be too much overhead? I believe WordPress does not come with a standard logging package?