public function run_cron($debug = false) { if ($debug) { echo "Starting bbpress Cron Job \n"; } $accounts = $this->get_accounts(); foreach ($accounts as $account) { $shub_bbpress_account = new shub_bbpress_account($account['shub_account_id']); $shub_bbpress_account->run_cron($debug); $forums = $shub_bbpress_account->get('items'); /* @var $forums shub_bbpress_item[] */ foreach ($forums as $forum) { $forum->run_cron($debug); } } if ($debug) { echo "Finished bbpress Cron Job \n"; } }