Plugin Directory

Changeset 2867112


Ignore:
Timestamp:
02/17/2023 05:35:25 PM (3 years ago)
Author:
prismtechstudios
Message:

Fix problem with duplicate ids

Location:
modern-footnotes
Files:
16 added
2 edited

Legend:

Unmodified
Added
Removed
  • modern-footnotes/trunk/modern-footnotes.php

    r2859760 r2867112  
    55Text Domain: modern-footnotes
    66Description: Add inline footnotes to your post via the footnote icon on the toolbar for editing posts and pages. Or, use the [mfn] or [modern_footnote] shortcodes [mfn]like this[/mfn].
    7 Version:     1.4.14
     7Version:     1.4.15
    88Author:      Prism Tech Studios
    99Author URI:  http://prismtechstudios.com/
     
    1515defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
    1616
    17 $modern_footnotes_version = '1.4.14';
     17$modern_footnotes_version = '1.4.15';
    1818
    1919$modern_footnotes_options = get_option('modern_footnotes_settings');
     
    198198  }
    199199
     200  //create a unique ID to use in HTML
     201  $content_id = "mfn-content-" . $scope_id . '-' . preg_replace('/[^a-zA-Z0-9-_]/i', '', $display_number);
     202
    200203  if (isset($atts['for_rss_feed']) && $atts['for_rss_feed']) {
    201204    $content = '<sup class="modern-footnotes-footnote ' . $additional_classes . '">' . $display_number . '</sup>'; // only display the superscript for RSS feeds
    202205  } else {
    203206    $content = '<sup class="modern-footnotes-footnote ' . $additional_classes . '" data-mfn="' . str_replace('"',"\\\"", $display_number) . '" data-mfn-post-scope="' . $scope_id . '">' .
    204                   '<a href="javascript:void(0)" ' . $additional_attributes . ' role="button" aria-pressed="false" aria-describedby="mfn-content-' . $scope_id . '">' . $display_number . '</a>' .
     207                  '<a href="javascript:void(0)" ' . $additional_attributes . ' role="button" aria-pressed="false" aria-describedby="' . $content_id . '">' . $display_number . '</a>' .
    205208                '</sup>' .
    206                 '<span id="mfn-content-' . $scope_id . '" role="tooltip" class="modern-footnotes-footnote__note" tabindex="0" data-mfn="' . str_replace('"',"\\\"", $display_number) . '">' . $content . '</span>'; //use a block element, not an inline element: otherwise, footnotes with line breaks won't display correctly
     209                '<span id="' . $content_id . '" role="tooltip" class="modern-footnotes-footnote__note" tabindex="0" data-mfn="' . str_replace('"',"\\\"", $display_number) . '">' . $content . '</span>'; //use a block element, not an inline element: otherwise, footnotes with line breaks won't display correctly
    207210  }
    208211 
  • modern-footnotes/trunk/readme.txt

    r2859760 r2867112  
    44Requires at least: 4.6
    55Tested up to: 6.1.1
    6 Stable tag: 1.4.14
     6Stable tag: 1.4.15
    77License: GNU General Public License v2
    88License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html
     
    8484== Changelog ==
    8585
     86= 1.4.15 =
     87* Fix for duplicate HTML ids
     88
    8689= 1.4.14 =
    8790* Minor fix for a PHP warning where foreach was attempting to access a null object
Note: See TracChangeset for help on using the changeset viewer.