Documentation

MCI_Footnotes_Task

Searches and replaces the footnotes.

Generates the reference container.

Tags
author

Stefan Herndler

since
1.5.0

Table of Contents

$a_arr_Footnotes  : array<string|int, mixed>
Contains all footnotes found on current public page.
$a_bool_AllowLoveMe  : bool
Flag if the display of 'LOVE FOOTNOTES' is allowed on the current public page.
$a_bool_AlternativeTooltipsEnabled  : mixed
$a_bool_HardLinksEnable  : bool|str|int
Hard links for AMP compatibility
$a_bool_MirrorTooltipText  : mixed
Dedicated tooltip text
$a_bool_SyntaxErrorFlag  : bool
Footnote delimiter syntax validation
$a_bool_TooltipsEnabled  : bool
Template process optimization
$a_int_PostId  : int
Infinite scroll / autoload or archive view
$a_int_ReferenceContainerId  : int
Multiple reference containers in content and widgets
$a_int_ScrollOffset  : int
Scroll offset
$a_int_TooltipShortcodeLength  : mixed
$a_str_FootnoteLinkSlug  : mixed
$a_str_LinkCloseTag  : mixed
$a_str_LinkIdsSeparator  : mixed
$a_str_LinkOpenTag  : mixed
$a_str_LinkSpan  : mixed
Optional link element for footnote referrers and backlinks
$a_str_PostContainerIdCompound  : mixed
$a_str_Prefix  : string
Prefix for the Footnote html element ID.
$a_str_ReferrerLinkSlug  : mixed
$a_str_TooltipShortcode  : mixed
exec()  : string
Replaces all footnotes that occur in the given content.
ReferenceContainer()  : string
Generates the reference container.
registerHooks()  : mixed
Register WordPress Hooks to replace Footnotes in the content of a public page.
search()  : string
Replaces all footnotes in the given content and appends them to the static property.
the_content()  : string
Replaces footnotes in the content of the current page/post.
the_excerpt()  : string
Replaces footnotes in the excerpt of the current page/post.
the_post()  : mixed
Replaces footnotes in each Content var of the current Post object.
the_title()  : string
Replaces footnotes in the post/page title.
widget_text()  : string
Replaces footnotes in the content of the current widget.
widget_title()  : string
Replaces footnotes in the widget title.
wp_footer()  : mixed
Displays the 'LOVE FOOTNOTES' slug if enabled.
wp_head()  : mixed
Outputs the custom css to the header of the public page.
replacePostObject()  : WP_Post
Replace all Footnotes in a WP_Post object.

Properties

$a_arr_Footnotes

Contains all footnotes found on current public page.

public static array<string|int, mixed> $a_arr_Footnotes = array()
Tags
author

Stefan Herndler

since
1.5.0

$a_bool_AllowLoveMe

Flag if the display of 'LOVE FOOTNOTES' is allowed on the current public page.

public static bool $a_bool_AllowLoveMe = rue
Tags
author

Stefan Herndler

since
1.5.0

$a_bool_AlternativeTooltipsEnabled

public static mixed $a_bool_AlternativeTooltipsEnabled = alse

$a_bool_HardLinksEnable

Hard links for AMP compatibility

public static bool|str|int $a_bool_HardLinksEnable = alse
Tags
since
2.0.0

Bugfix: footnote links script independent.

  • Bugfix: Referrers and backlinks: remove hard links to streamline browsing history, thanks to @theroninjedi47 bug report.
since
2.0.4
since
2.3.0
reporter

@theroninjedi47

reporter

@psykonevro

link
  • Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
link
https://wordpress.org/support/topic/making-it-amp-compatible/
link

The official AMP plugin strips off JavaScript, breaking Footnotes’ animated scrolling. When the alternative reference container is enabled, hard links are too.

contributor

@martinneumannat

$a_bool_MirrorTooltipText

Dedicated tooltip text

public static mixed $a_bool_MirrorTooltipText = alse
  • Update: Tooltips: ability to display dedicated content before [[/tooltip]], thanks to @jbj2199 issue report.
Tags
since
2.5.2
date

2021-01-19T2223+0100

reporter

@jbj2199

link

Tooltips can display another content than the footnote entry in the reference container. The trigger is a shortcode in the footnote text separating the tooltip text from the note. That is consistent with what WordPress does for excerpts.

$a_bool_SyntaxErrorFlag

Footnote delimiter syntax validation

public static bool $a_bool_SyntaxErrorFlag = rue
  • Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes.
Tags
since
2.4.0
date

2021-01-01T0227+0100

$a_int_PostId

Infinite scroll / autoload or archive view

public static int $a_int_PostId = 0
  • Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness code contribution
Tags
since
2.0.6
contributor

@docteurfitness

link
https://wordpress.org/support/topic/auto-load-post-compatibility-update/#post-13618833
link

As multiple posts are appended to each other, functions and fragment IDs must be disambiguated. post ID to make everything unique wrt infinite scroll and archive view:

reporter

@docteurfitness

$a_int_ScrollOffset

Scroll offset

public static int $a_int_ScrollOffset = 34
  • Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers.
Tags
since
2.1.4
since
2.4.0
date

2020-12-05T0538+0100

  • Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report.
date

2021-01-03T2055+0100

date

2021-01-04T0504+0100

reporter

@lukashuggenberg

link
https://wordpress.org/support/topic/2-2-6-breaks-all-footnotes/#post-13857922

$a_int_TooltipShortcodeLength

public static mixed $a_int_TooltipShortcodeLength = 12

$a_str_FootnoteLinkSlug

public static mixed $a_str_FootnoteLinkSlug = 'f'

$a_str_LinkCloseTag

public static mixed $a_str_LinkCloseTag = ''

$a_str_LinkIdsSeparator

public static mixed $a_str_LinkIdsSeparator = '+'

$a_str_LinkOpenTag

public static mixed $a_str_LinkOpenTag = ''

$a_str_LinkSpan

Optional link element for footnote referrers and backlinks

public static mixed $a_str_LinkSpan = 'span'
Tags
since
2.0.0

add link elements along with hard links.

  • Bugfix: Referrers and backlinks: Styling: make link elements optional to fix issues, thanks to @docteurfitness issue report and code contribution.
since
2.1.4
since
2.3.0
date

2020-11-25T1306+0100

date

2020-11-26T1051+0100

date

2020-12-30T2313+0100

contributor

@docteurfitness

contributor

@martinneumannat

link
https://wordpress.org/support/topic/update-2-1-3/#post-13704194
link
  • Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro bug report, thanks to @martinneumannat code contribution.
link
https://wordpress.org/support/topic/making-it-amp-compatible/
link

Although widely used for that purpose, hyperlinks are disliked for footnote linking. Browsers may need to be prevented from logging these clicks in the browsing history, as logging compromises the usability of the 'return to previous' button in browsers. For that purpose, and for scroll animation, this linking is performed by JavaScript.

Link elements raise concerns, so that mitigating their proliferation may be desired.

By contrast, due to an insufficiency in the CSS standard, coloring elements with the theme’s link color requires real link elements and cannot be done with named colors, as CSS does not support 'color: link|hover|active|visited', after the pseudo-classes of the link element.

Yet styling these elements with the link color is not universally preferred, so that the very presence of these link elements may need to be avoided.

reporter

@docteurfitness

reporter

@psykonevro

see
self::$a_bool_HardLinksEnable

$a_str_PostContainerIdCompound

public static mixed $a_str_PostContainerIdCompound = ''

$a_str_Prefix

Prefix for the Footnote html element ID.

public static string $a_str_Prefix = ""
Tags
author

Stefan Herndler

since
1.5.8

$a_str_ReferrerLinkSlug

public static mixed $a_str_ReferrerLinkSlug = 'r'

$a_str_TooltipShortcode

public static mixed $a_str_TooltipShortcode = '[[/tooltip]]'

Methods

exec()

Replaces all footnotes that occur in the given content.

public exec(string $p_str_Content[, bool $p_bool_OutputReferences = false ][, bool $p_bool_HideFootnotesText = false ]) : string
Parameters
$p_str_Content : string

Any string that may contain footnotes to be replaced.

$p_bool_OutputReferences : bool = false

Appends the Reference Container to the output if set to true, default true.

$p_bool_HideFootnotesText : bool = false

Hide footnotes found in the string.

Tags
author

Stefan Herndler

since
1.5.0
since
2.2.0

Adding: Reference container: support for custom position shortcode, thanks to @hamshe issue report.

since
2.2.5

Bugfix: Reference container: delete position shortcode if unused because position may be widget or footer, thanks to @hamshe bug report.

Return values
string

ReferenceContainer()

Generates the reference container.

public ReferenceContainer() : string
Tags
author

Stefan Herndler

since
1.5.0
since
2.0.0

Update: remove backlink symbol along with column 2 of the reference container

since
2.0.3

Bugfix: prepend an arrow on user request

since
2.0.6

Bugfix: Reference container: fix line breaking behavior in footnote number clusters.

since
2.0.4

Bugfix: restore the arrow select and backlink symbol input settings

since
2.1.1

Bugfix: Referrers, reference container: Combining identical footnotes: fix dead links and ensure referrer-backlink bijectivity, thanks to @happyches bug report.

since
2.1.1

Bugfix: Reference container: Backlink symbol: make optional, not suggest configuring it to invisible, thanks to @spaceling feedback.

Return values
string

registerHooks()

Register WordPress Hooks to replace Footnotes in the content of a public page.

public registerHooks() : mixed
Tags
author

Stefan Herndler

since
1.5.0
since
1.5.4

Adding: Hooks: support 'the_post' in response to user request for custom post types.

since
2.0.5

Bugfix: Reference container: fix relative position through priority level, thanks to @june01 @imeson @spaceling bug reports, thanks to @spaceling code contribution.

since
2.0.5

Update: Hooks: Default-enable all hooks to prevent footnotes from seeming broken in some parts.

since
2.0.6

Bugfix: Priority level back to PHP_INT_MAX (ref container positioning not this plugin’s responsibility).

since
2.0.7

BUGFIX: Hooks: Default-disable 'the_post', thanks to @spaceling @markcheret @nyamachi @whichgodsaves @spiralofhope2 @mmallett @andreasra @widecast @ymorin007 @tashi1es bug reports.

since
2.0.7

Bugfix: Set priority level back to 10 assuming it is unproblematic 2020-11-06T1344+0100.

since
2.0.8

Bugfix: Priority level back to PHP_INT_MAX (need to get in touch with other plugins).

since
2.1.0

UPDATE: Hooks: remove 'the_post', the plugin stops supporting this hook.

since
2.1.1

Bugfix: Dashboard: priority level setting for the_content hook, thanks to @imeson bug report.

since
2.1.2

Bugfix: Dashboard: priority level settings for all other hooks, thanks to @nikelaos bug report.

since
2.5.0

Bugfix: Hooks: support footnotes on category pages, thanks to @vitaefit bug report, thanks to @misfist code contribution.

since
2.5.1

Bugfix: Hooks: support footnotes in Popup Maker popups, thanks to @squatcher bug report.

Return values
mixed

Replaces all footnotes in the given content and appends them to the static property.

public search(string $p_str_Content, bool $p_bool_ConvertHtmlChars, bool $p_bool_HideFootnotesText) : string
Parameters
$p_str_Content : string

Content to be searched for footnotes.

$p_bool_ConvertHtmlChars : bool

html encode settings, default true.

$p_bool_HideFootnotesText : bool

Hide footnotes found in the string.

Tags
author

Stefan Herndler

since
1.5.0
since
2.0.0

various.

since
2.4.0

Adding: Footnote delimiters: syntax validation for balanced footnote start and end tag short codes.

since
2.5.0

Bugfix: Footnote delimiters: Syntax validation: exclude certain cases involving scripts, thanks to @andreasra bug report.

since
2.5.0

Bugfix: Footnote delimiters: Syntax validation: complete message with hint about setting, thanks to @andreasra bug report.

since
2.5.0

Bugfix: Footnote delimiters: Syntax validation: limit length of quoted string to 300 characters, thanks to @andreasra bug report.

Return values
string

the_content()

Replaces footnotes in the content of the current page/post.

public the_content(string $p_str_Content) : string
Parameters
$p_str_Content : string

Page/Post content.

Tags
author

Stefan Herndler

since
1.5.0
Return values
string

Content with replaced footnotes.

the_excerpt()

Replaces footnotes in the excerpt of the current page/post.

public the_excerpt(string $p_str_Content) : string
Parameters
$p_str_Content : string

Page/Post content.

Tags
author

Stefan Herndler

since
1.5.0
Return values
string

Content with replaced footnotes.

the_post()

Replaces footnotes in each Content var of the current Post object.

public the_post(array<string|int, mixed>|WP_Post &$p_mixed_Posts) : mixed
Parameters
$p_mixed_Posts : array<string|int, mixed>|WP_Post
Tags
author

Stefan Herndler

since
1.5.4
Return values
mixed

the_title()

Replaces footnotes in the post/page title.

public the_title(string $p_str_Content) : string
Parameters
$p_str_Content : string

Widget content.

Tags
author

Stefan Herndler

since
1.5.0
Return values
string

Content with replaced footnotes.

widget_text()

Replaces footnotes in the content of the current widget.

public widget_text(string $p_str_Content) : string
Parameters
$p_str_Content : string

Widget content.

Tags
author

Stefan Herndler

since
1.5.0
Return values
string

Content with replaced footnotes.

widget_title()

Replaces footnotes in the widget title.

public widget_title(string $p_str_Content) : string
Parameters
$p_str_Content : string

Widget content.

Tags
author

Stefan Herndler

since
1.5.0
Return values
string

Content with replaced footnotes.

Displays the 'LOVE FOOTNOTES' slug if enabled.

public wp_footer() : mixed
Tags
author

Stefan Herndler

since
1.5.0
since
2.2.0

more options 2020-12-11T0506+0100

Return values
mixed

wp_head()

Outputs the custom css to the header of the public page.

public wp_head() : mixed
Tags
author

Stefan Herndler

since
1.5.0
since
2.1.1

Bugfix: Reference container: fix start pages by making its display optional, thanks to @dragon013 bug report.

since
2.1.1

Bugfix: Tooltips: optional alternative JS implementation with CSS transitions to fix configuration-related outage, thanks to @andreasra feedback.

since
2.1.3

raise settings priority to override theme stylesheets

since
2.1.4

Bugfix: Tooltips: Styling: fix font size issue by adding font size to settings with legacy as default.

since
2.1.4

Bugfix: Reference container: fix layout issues by moving backlink column width to settings.

since
2.2.5

Bugfix: Reference container: Label: make bottom border an option, thanks to @markhillyer issue report.

since
2.2.5

Bugfix: Reference container: Label: option to select paragraph or heading element, thanks to @markhillyer issue report.

since
2.3.0

Bugfix: Reference container: convert top padding to margin and make it a setting, thanks to @hamshe bug report.

since
2.5.4

Bugfix: Referrers: optional fixes to vertical alignment, font size and position (static) for in-theme consistency and cross-theme stability, thanks to @tomturowski bug report.

Return values
mixed

replacePostObject()

Replace all Footnotes in a WP_Post object.

private replacePostObject(WP_Post $p_obj_Post) : WP_Post
Parameters
$p_obj_Post : WP_Post
Tags
author

Stefan Herndler

since
1.5.6
Return values
WP_Post

Search results