/** * Bulk push all posts to GitHub */ function export() { global $wpdb; $posts = $wpdb->get_col("SELECT ID FROM {$wpdb->posts} WHERE post_status = 'publish' AND post_type IN ('post', 'page' )"); foreach ($posts as $post_id) { $post = new WordPress_GitHub_Sync_Post($post_id); $post->push(); } }