Non-numeric footnotes
-
First off: awesome footnote plugin. I’ve tried at least three over the years, this one is by far the best.
I was pleasantly surprised to discover that I could use something other than a number when using the ‘referencenumber’ attribute. I have had no problems unless the very first footnote is non-numeric. If it is, there is an exception generated on line 172 of modern-footnotes.php Looking at the code within that file, I found that if I changed the following from
if (!isset($modern_footnotes_all_posts_data[$scope_id])) { $modern_footnotes_all_posts_data[$scope_id] = array( 'modern_footnotes_post_number' => $GLOBALS['current_modern_footnotes_post_number'], 'used_reference_numbers' => array($display_number), 'footnotes' => array( $display_number => $content ) ); $GLOBALS['current_modern_footnotes_post_number']++; }
to
if (!isset($modern_footnotes_all_posts_data[$scope_id])) { $used_reference_numbers_array = array(); if (is_numeric($display_number)) { array_push($used_reference_numbers_array, $display_number); } $modern_footnotes_all_posts_data[$scope_id] = array( 'modern_footnotes_post_number' => $GLOBALS['current_modern_footnotes_post_number'], 'used_reference_numbers' => $used_reference_numbers_array, 'footnotes' => array( $display_number => $content ) ); $GLOBALS['current_modern_footnotes_post_number']++; }
that it worked. This is not tested except locally by me. So, a request: officially allow non-numeric footnotes.
thanks for all of the work!
- The topic ‘Non-numeric footnotes’ is closed to new replies.