/** * Deletes all content created by this plugin */ function rssmi_restore_all() { rssmi_delete_autoposts(); $delete_posts_args = array('post_type' => array('rssmi_feed_item', 'rssmi_feed'), 'posts_per_page' => -1, 'post_status' => array('publish', 'pending', 'draft', 'auto-draft', 'private', 'inherit', 'trash')); $delete_posts = get_posts($delete_posts_args); if (empty($delete_posts)) { return; } foreach ($delete_posts as $delete_me) { $pid = $delete_me->ID; rssmi_delete_attachment($pid); wp_delete_post($pid, TRUE); } }
function rssmi_delete_autopost_admin() { rssmi_delete_autoposts(); }