public function startBibliography( array $args ) { ++$this->bibliographyLevel; # If a bibliography already exists, or is nested, ignore it, but keep track of nesting level. if ( isset( $this->bibliography ) || $this->bibliographyLevel > 1 ) { return; } $this->bibliography = WCBibliography::getBibliography( $args, $this->currentDefaultStyle ); }
} } /** * Replace endnote marker with rendered endnotes. */ if ( $this->endnoteMarker ) { if ( $this->notes ) { $endnoteText = '<ol class="endnotes"' . $this->styleHTML . '>' . PHP_EOL; foreach( $this->notes as $key => $note ) { $endnoteText .= $note->render( $bibliographyExists ); } $endnoteText .= '</ol>'; } else { $endnoteText = ''; } $pos = strpos( $text, $this->endnoteMarker ); if ( $pos !== false ) { $text = substr_replace( $text, $endnoteText, $pos, strlen( $this->endnoteMarker ) ); } } } } /** * Static initializer. */ WCBibliography::init();
/** * Static initializer. */ public static function init() { $citeStyleMW = MagicWord::get( 'wc_citestyle_attrib' ); self::$citeStyleAttributeWords = $citeStyleMW->getSynonyms(); $typeMW = MagicWord::get( 'wc_type_attrib' ); self::$typeAttributeWords = $typeMW->getSynonyms(); }