Menu

## Footnotes_Task

task.php : 95

Searches and replaces the footnotes and generates the reference container.

##### Tags

since
  1.5.0

### Table of Contents

$a_arr_footnotes : array<string|int, mixed>
  Contains all footnotes found in the searched content.
$a_bool_allow_love_me : bool
  Flag if the display of 'LOVE FOOTNOTES' is allowed on the current public page.
$a_bool_hard_links_enabled : bool
  Hard links for AMP compatibility.
$a_bool_mirror_tooltip_text : bool
  Whether to mirror the tooltip text in the reference container.
$a_bool_syntax_error_flag : bool
  Footnote delimiter syntax validation enabled.
$a_int_post_id : int
  Autoload a.k.a. infinite scroll, or archive view.
$a_int_reference_container_id : int
  Multiple reference containers in content and widgets.
$a_int_scroll_offset : int
  Scroll offset.
$a_int_tooltip_shortcode_length : int
  The tooltip delimiter shortcode length.
$a_str_end_tag : str
  Footnote delimiter end short code.
$a_str_end_tag_regex : str
  Footnote delimiter end short code in regex format.
$a_str_footnote_link_slug : str
  The footnote slug.
$a_str_link_close_tag : str
  The closing tag.
$a_str_link_open_tag : str
  The opening tag.
$a_str_link_span : str
  The span element name.
$a_str_post_container_id_compound : str
  Contains the concatenated fragment ID base.
$a_str_prefix : string
  Prefix for the Footnote html element ID.
$a_str_referrer_link_slug : str
  The referrer slug.
$a_str_start_tag : str
  Footnote delimiter start short code.
$a_str_start_tag_regex : str
  Footnote delimiter start short code in regex format.
$a_str_tooltip_shortcode : str
  The tooltip delimiter shortcode.
$a_str_link_ids_separator : str
  The slug and identifier separator.
exec() : string
  Replaces all footnotes that occur in the given content.
footnotes_in_content() : string
  Replaces footnotes in the content of the current page/post.
footnotes_in_excerpt() : string
  Processes existing excerpt or replaces it with a new one generated on the basis of the post.
footnotes_in_title() : string
  Replaces footnotes in the post/page title.
footnotes_in_widget_text() : string
  Replaces footnotes in the content of the current widget.
footnotes_in_widget_title() : string
  Replaces footnotes in the widget title.
footnotes_output_footer() : mixed
  Displays the 'LOVE FOOTNOTES' slug if enabled.
footnotes_output_head() : mixed
  Outputs the custom css to the header of the public page.
generate_excerpt() : string
  Generates excerpt on the basis of the post.
generate_excerpt_with_footnotes() : string
  Generates excerpt with footnotes on the basis of the post.
reference_container() : string
  Generates the reference container.
register_hooks() : 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.
unify_delimiters() : mixed
  Brings the delimiters and unifies their various HTML escapement schemas.

### Properties

#### $a_arr_footnotes

task.php : 103

Contains all footnotes found in the searched content.

`public static array<string|int, mixed> $a_arr_footnotes = array()`

##### Tags

since
  1.5.0

#### $a_bool_allow_love_me

task.php : 111

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

`public static bool $a_bool_allow_love_me = rue`

##### Tags

since
  1.5.0

#### $a_bool_hard_links_enabled

task.php : 182

Hard links for AMP compatibility.

`public static bool $a_bool_hard_links_enabled = 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
  - Adding: Referrers and backlinks: optional hard links for AMP compatibility, thanks to @psykonevro issue report, thanks to @martinneumannat issue report and code contribution.
since
  2.3.0
reporter

  @theroninjedi47

reporter

  @psykonevro

link
  https://wordpress.org/support/topic/hyperlinked-footnotes-creating-excessive-back-history/
link
  https://wordpress.org/support/topic/making-it-amp-compatible/
link
  https://wordpress.org/support/topic/footnotes-is-not-amp-compatible/
contributor

  @martinneumannat

#### $a_bool_mirror_tooltip_text

task.php : 343

Whether to mirror the tooltip text in the reference container.

`public static bool $a_bool_mirror_tooltip_text = alse`

##### Tags

since
  2.5.2

#### $a_bool_syntax_error_flag

task.php : 398

Footnote delimiter syntax validation enabled.

`public static bool $a_bool_syntax_error_flag = rue`

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

##### Tags

since
  2.4.0

#### $a_int_post_id

task.php : 138

Autoload a.k.a. infinite scroll, or archive view.

`public static int $a_int_post_id = 0`

- Bugfix: Infinite scroll: debug autoload by adding post ID, thanks to @docteurfitness issue report and code contribution

##### Tags

reporter

  @docteurfitness

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

  @docteurfitness

since
  2.0.6

#### $a_int_reference_container_id

task.php : 156

Multiple reference containers in content and widgets.

`public static int $a_int_reference_container_id = 1`

- Bugfix: Reference container, widget_text hook: support for multiple containers in a page, thanks to @justbecuz bug report.

##### Tags

reporter

  @justbecuz

link
  https://wordpress.org/support/topic/reset-footnotes-to-1/
link
  https://wordpress.org/support/topic/reset-footnotes-to-1/#post-13662830
since
  2.2.9

#### $a_int_scroll_offset

task.php : 235

Scroll offset.

`public static int $a_int_scroll_offset = 34`

- Bugfix: Scroll offset: make configurable to fix site-dependent issues related to fixed headers.

##### Tags

since
  2.1.4
  - Bugfix: Scroll offset: initialize to safer one third window height for more robustness, thanks to @lukashuggenberg bug report.
since
  2.4.0
reporter

  @lukashuggenberg

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

#### $a_int_tooltip_shortcode_length

task.php : 335

The tooltip delimiter shortcode length.

`public static int $a_int_tooltip_shortcode_length = 12`

##### Tags

since
  2.5.2

#### $a_str_end_tag

task.php : 361

Footnote delimiter end short code.

`public static str $a_str_end_tag = ''`

##### Tags

since
  1.5.0

  (constant, variable)

since
  2.6.2

  (property)

#### $a_str_end_tag_regex

task.php : 379

Footnote delimiter end short code in regex format.

`public static str $a_str_end_tag_regex = ''`

##### Tags

since
  2.4.0

  (variable)

since
  2.6.2

  (property)

#### $a_str_footnote_link_slug

task.php : 198

The footnote slug.

`public static str $a_str_footnote_link_slug = 'f'`

##### Tags

since
  2.3.0

#### $a_str_link_close_tag

task.php : 303

The closing tag.

`public static str $a_str_link_close_tag = ''`

##### Tags

since
  2.3.0

#### $a_str_link_open_tag

task.php : 295

The opening tag.

`public static str $a_str_link_open_tag = ''`

##### Tags

since
  2.3.0

#### $a_str_link_span

task.php : 287

The span element name.

`public static str $a_str_link_span = 'span'`

##### Tags

since
  2.3.0

#### $a_str_post_container_id_compound

task.php : 214

Contains the concatenated fragment ID base.

`public static str $a_str_post_container_id_compound = ''`

##### Tags

since
  2.3.0

#### $a_str_prefix

task.php : 119

Prefix for the Footnote html element ID.

`public static string $a_str_prefix = ''`

##### Tags

since
  1.5.8

#### $a_str_referrer_link_slug

task.php : 190

The referrer slug.

`public static str $a_str_referrer_link_slug = 'r'`

##### Tags

since
  2.3.0

#### $a_str_start_tag

task.php : 352

Footnote delimiter start short code.

`public static str $a_str_start_tag = ''`

##### Tags

since
  1.5.0

  (constant, variable)

since
  2.6.2

  (property)

#### $a_str_start_tag_regex

task.php : 370

Footnote delimiter start short code in regex format.

`public static str $a_str_start_tag_regex = ''`

##### Tags

since
  2.4.0

  (variable)

since
  2.6.2

  (property)

#### $a_str_tooltip_shortcode

task.php : 327

The tooltip delimiter shortcode.

`public static str $a_str_tooltip_shortcode = '[[/tooltip]]'`

##### Tags

since
  2.5.2

#### $a_str_link_ids_separator

task.php : 206

The slug and identifier separator.

`private static str $a_str_link_ids_separator = '+'`

##### Tags

since
  2.3.0

### Methods

#### exec()

task.php : 1381

Replaces all footnotes that occur in the given content.

`public exec(string $p_str_content[, bool $p_bool_output_references = false ][, bool $p_bool_hide_footnotes_text = false ]) : string`

##### Parameters

$p_str_content : string

  Any string that may contain footnotes to be replaced.

$p_bool_output_references : bool = false

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

$p_bool_hide_footnotes_text : bool = false

  Hide footnotes found in the string.

##### Tags

since
  1.5.0

##### Return values

string —

#### footnotes_in_content()

task.php : 1098

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

`public footnotes_in_content(string $p_str_content) : string`

##### Parameters

$p_str_content : string

  Page/Post content.

##### Tags

since
  1.5.0
  - Adding: Reference container: optionally per section by shortcode, thanks to @grflukas issue report.
since
  2.7.0
reporter

  @grflukas

link
  https://wordpress.org/support/topic/multiple-reference-containers-in-single-post/

##### Return values

string —

$p_str_content Content with replaced footnotes.

#### footnotes_in_excerpt()

task.php : 1153

Processes existing excerpt or replaces it with a new one generated on the basis of the post.

`public footnotes_in_excerpt(string $p_str_excerpt) : string`

##### Parameters

$p_str_excerpt : string

  Excerpt content.

##### Tags

since
  1.5.0
since
  2.6.2

  Debug No option.

since
  2.6.3

  Debug Yes option, the setting becomes fully effective.

  - Bugfix: Excerpts: make excerpt handling backward compatible, thanks to @mfessler bug report.
since
  2.7.0

  The input was already the processed excerpt, no more footnotes to search. But issue #65 brought up that manual excerpts can include processable footnotes. Default 'manual' is fallback and is backward compatible with the initial setup.

reporter

  @mfessler

link
  https://github.com/markcheret/footnotes/issues/65

##### Return values

string —

$p_str_excerpt Processed or new excerpt.

#### footnotes_in_title()

task.php : 1079

Replaces footnotes in the post/page title.

`public footnotes_in_title(string $p_str_content) : string`

##### Parameters

$p_str_content : string

  Title.

##### Tags

since
  1.5.0

##### Return values

string —

$p_str_content Title with replaced footnotes.

#### footnotes_in_widget_text()

task.php : 1365

Replaces footnotes in the content of the current widget.

`public footnotes_in_widget_text(string $p_str_content) : string`

##### Parameters

$p_str_content : string

  Widget content.

##### Tags

since
  1.5.0

##### Return values

string —

$p_str_content Content with replaced footnotes.

#### footnotes_in_widget_title()

task.php : 1353

Replaces footnotes in the widget title.

`public footnotes_in_widget_title(string $p_str_content) : string`

##### Parameters

$p_str_content : string

  Widget content.

##### Tags

since
  1.5.0

##### Return values

string —

$p_str_content Content with replaced footnotes.

#### footnotes_output_footer()

task.php : 1021

Displays the 'LOVE FOOTNOTES' slug if enabled.

`public footnotes_output_footer() : mixed`

##### Tags

since
  1.5.0
since
  2.2.0

  More options.

##### Return values

mixed —

#### footnotes_output_head()

task.php : 583

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

`public footnotes_output_head() : mixed`

##### Tags

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 —

#### generate_excerpt()

task.php : 1189

Generates excerpt on the basis of the post.

`public generate_excerpt(string $p_str_content) : string`

- Bugfix: Excerpts: debug the 'No' option by generating excerpts on the basis of the post without footnotes, thanks to @nikelaos @markcheret @martinneumannat bug reports.

##### Parameters

$p_str_content : string

  The post.

##### Tags

reporter

  @nikelaos

reporter

  @markcheret

reporter

  @martinneumannat

link
  https://wordpress.org/support/topic/jquery-comes-up-in-feed-content/
link
  https://wordpress.org/support/topic/doesnt-work-with-mailpoet/
link
  https://wordpress.org/support/topic/footnotes-now-appear-in-summaries-even-though-this-is-marked-no/
link
  https://wordpress.org/support/topic/problem-with-footnotes-in-excerpts-of-the-blog-page/
link
  https://developer.wordpress.org/reference/functions/wp_trim_excerpt/
link
  https://developer.wordpress.org/reference/functions/wp_trim_words/
since
  2.6.2

##### Return values

string —

$p_str_content An excerpt of the post. Applies full WordPress excerpt processing.

#### generate_excerpt_with_footnotes()

task.php : 1253

Generates excerpt with footnotes on the basis of the post.

`public generate_excerpt_with_footnotes(string $p_str_content) : string`

- Bugfix: Excerpts: debug the 'Yes' option by generating excerpts with footnotes on the basis of the posts, thanks to @nikelaos @martinneumannat bug reports.

##### Parameters

$p_str_content : string

  The post.

##### Tags

reporter

  @nikelaos

reporter

  @martinneumannat

reporter

  @scroom

reporter

  @copylefter

reporter

  @lagoon24

link
  https://wordpress.org/support/topic/jquery-comes-up-in-feed-content/
link
  https://wordpress.org/support/topic/doesnt-work-with-mailpoet/
link
  https://wordpress.org/support/topic/problem-with-footnotes-in-excerpts-of-the-blog-page/
link
  https://wordpress.org/support/topic/update-crashed-my-website-3/
link
  https://wordpress.org/support/topic/update-crashed-my-website-3/#post-14259151
link
  https://wordpress.org/support/topic/update-crashed-my-website-3/#post-14259396
link
  https://wordpress.org/plugins/advanced-excerpt/
since
  2.6.3
  - Bugfix: Process: remove trailing comma after last argument in multiline function calls for PHP < 7.3, thanks to @scroom @copylefter @lagoon24 bug reports.
since
  2.6.4
see
  self::generate_excerpt()

  Uses information and some code from Advanced Excerpt.

##### Return values

string —

$p_str_content An excerpt of the post. Does not apply full WordPress excerpt processing.

#### reference_container()

task.php : 2263

Generates the reference container.

`public reference_container() : string`

##### Tags

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 —

#### register_hooks()

task.php : 418

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

`public register_hooks() : mixed`

##### Tags

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.

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 —

#### search()

task.php : 1540

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

`public search(string $p_str_content, bool $p_bool_hide_footnotes_text) : string`

##### Parameters

$p_str_content : string

  Any content to be searched for footnotes.

$p_bool_hide_footnotes_text : bool

  Hide footnotes found in the string.

##### Tags

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.

  - Bugfix: Footnote delimiter short codes: debug closing pointy brackets in the Block Editor by accounting for unbalanced HTML escapement, thanks to @patrick_here @alifarahani8000 bug reports.
since
  2.5.13
reporter

  @patrick_here

reporter

  @alifarahani8000

link
  https://wordpress.org/support/topic/how-to-add-footnotes-shortcode-in-elementor/
link
  https://wordpress.org/support/topic/after-version-2-5-10-the-ref-or-tags-are-not-longer-working/

##### Return values

string —

#### unify_delimiters()

task.php : 1459

Brings the delimiters and unifies their various HTML escapement schemas.

`public unify_delimiters(string $p_str_content) : mixed`

##### Parameters

$p_str_content : string

  TODO.

  - Bugfix: Footnote delimiter short codes: fix numbering bug by cross-editor HTML escapement schema unification, thanks to @patrick_here @alifarahani8000 @gova bug reports.

##### Tags

reporter

  @patrick_here

reporter

  @alifarahani8000

reporter

  @gova

link
  https://wordpress.org/support/topic/how-to-add-footnotes-shortcode-in-elementor/
link
  https://wordpress.org/support/topic/after-version-2-5-10-the-ref-or-tags-are-not-longer-working/
link
  https://wordpress.org/support/topic/footnotes-content-number-not-sequential/
since
  2.1.14

  While the Classic Editor (visual mode) escapes both pointy brackets, the Block Editor enforces balanced escapement only in code editor mode when the opening tag is already escaped. In visual mode, the Block Editor does not escape the greater-than sign.

##### Return values

mixed —

## Search results