/** * Utility method to return the wikitext for an article */ public static function getWikitext(&$dbr, $title) { global $wgTitle; if (!$title) { return false; } // try to see if the wikihow article editor instance already has this title loaded $whow = WikihowArticleEditor::wikiHowArticleIfMatchingTitle($title); if ($whow) { $wikitext = $whow->mLoadText; } else { $rev = Revision::loadFromTitle($dbr, $title); if (!$rev) { return false; } $wikitext = $rev->getText(); } return $wikitext; }