Bug where everytime before printing paper would gram word from vocabulary, not just when there is a shortcode in a content.
This commit is contained in:
@@ -62,6 +62,9 @@ class HtmlToPos
|
|||||||
|
|
||||||
public function vocabularyWord($posText)
|
public function vocabularyWord($posText)
|
||||||
{
|
{
|
||||||
|
if (strstr($posText, '[vocabulary_word]')
|
||||||
|
|| strpos($posText, '[vocabulary_short]')
|
||||||
|
|| strpos($posText, '[vocabulary_long]')) {
|
||||||
$voc = new Vocabulary();
|
$voc = new Vocabulary();
|
||||||
$randomWord = $voc->getRandomWord();
|
$randomWord = $voc->getRandomWord();
|
||||||
$word = $voc->getWord($randomWord);
|
$word = $voc->getWord($randomWord);
|
||||||
@@ -69,6 +72,7 @@ class HtmlToPos
|
|||||||
$posText = str_replace('[vocabulary_word]', $word->word, $posText);
|
$posText = str_replace('[vocabulary_word]', $word->word, $posText);
|
||||||
$posText = str_replace('[vocabulary_short]', $word->short, $posText);
|
$posText = str_replace('[vocabulary_short]', $word->short, $posText);
|
||||||
$posText = str_replace('[vocabulary_long]', $word->long, $posText);
|
$posText = str_replace('[vocabulary_long]', $word->long, $posText);
|
||||||
|
}
|
||||||
|
|
||||||
return $posText;
|
return $posText;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user