diff --git a/includes/utilities.php b/includes/utilities.php index 698d7a8..7e2333d 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -110,8 +110,10 @@ add_filter('the_content', 'apply_footnotes_urls_to_content', 10); function apply_footnotes_urls_to_content($content) { $post_type = get_post_type(); + if ($post_type !== 'articles' && !is_admin()) return $content; + $footnotes = build_footnotes_index_from_content($content); $dom = new DOMDocument(); @$dom->loadHTML(mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD); @@ -120,6 +122,7 @@ function apply_footnotes_urls_to_content($content) foreach ($links as $key => $link) { if ($link->hasAttribute('class') && strpos($link->getAttribute('class'), 'footnote-reference') !== false) { $link->setAttribute('id', 'footnote-' . $key + 1); + write_log($link->getAttribute('id')); } }