Footnotes_Task
in package
Searches and replaces the footnotes and generates the reference container.
Tags
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.
- __construct() : mixed
- Initialize the class and set its properties.
- 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
Contains all footnotes found in the searched content.
public
static array<string|int, mixed>
$a_arr_footnotes
= array()
Tags
$a_bool_allow_love_me
Flag if the display of 'LOVE FOOTNOTES' is allowed on the current public page.
public
static bool
$a_bool_allow_love_me
= rue
Tags
$a_bool_hard_links_enabled
Hard links for AMP compatibility.
public
static bool
$a_bool_hard_links_enabled
= alse
Tags
$a_bool_mirror_tooltip_text
Whether to mirror the tooltip text in the reference container.
public
static bool
$a_bool_mirror_tooltip_text
= alse
Tags
$a_bool_syntax_error_flag
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
$a_int_post_id
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
$a_int_reference_container_id
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
$a_int_scroll_offset
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
$a_int_tooltip_shortcode_length
The tooltip delimiter shortcode length.
public
static int
$a_int_tooltip_shortcode_length
= 12
Tags
$a_str_end_tag
Footnote delimiter end short code.
public
static str
$a_str_end_tag
= ''
Tags
$a_str_end_tag_regex
Footnote delimiter end short code in regex format.
public
static str
$a_str_end_tag_regex
= ''
Tags
$a_str_footnote_link_slug
The footnote slug.
public
static str
$a_str_footnote_link_slug
= 'f'
Tags
$a_str_link_close_tag
The closing tag.
public
static str
$a_str_link_close_tag
= ''
Tags
$a_str_link_open_tag
The opening tag.
public
static str
$a_str_link_open_tag
= ''
Tags
$a_str_link_span
The span element name.
public
static str
$a_str_link_span
= 'span'
Tags
$a_str_post_container_id_compound
Contains the concatenated fragment ID base.
public
static str
$a_str_post_container_id_compound
= ''
Tags
$a_str_prefix
Prefix for the Footnote html element ID.
public
static string
$a_str_prefix
= ''
Tags
$a_str_referrer_link_slug
The referrer slug.
public
static str
$a_str_referrer_link_slug
= 'r'
Tags
$a_str_start_tag
Footnote delimiter start short code.
public
static str
$a_str_start_tag
= ''
Tags
$a_str_start_tag_regex
Footnote delimiter start short code in regex format.
public
static str
$a_str_start_tag_regex
= ''
Tags
$a_str_tooltip_shortcode
The tooltip delimiter shortcode.
public
static str
$a_str_tooltip_shortcode
= '[[/tooltip]]'
Tags
$a_str_link_ids_separator
The slug and identifier separator.
private
static str
$a_str_link_ids_separator
= '+'
Tags
Methods
__construct()
Initialize the class and set its properties.
public
__construct() : mixed
Tags
Return values
mixed —exec()
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
Return values
string —footnotes_in_content()
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
Return values
string —$p_str_content Content with replaced footnotes.
footnotes_in_excerpt()
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
Return values
string —$p_str_excerpt Processed or new excerpt.
footnotes_in_title()
Replaces footnotes in the post/page title.
public
footnotes_in_title(string $p_str_content) : string
Parameters
- $p_str_content : string
-
Title.
Tags
Return values
string —$p_str_content Title with replaced footnotes.
footnotes_in_widget_text()
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
Return values
string —$p_str_content Content with replaced footnotes.
footnotes_in_widget_title()
Replaces footnotes in the widget title.
public
footnotes_in_widget_title(string $p_str_content) : string
Parameters
- $p_str_content : string
-
Widget content.
Tags
Return values
string —$p_str_content Content with replaced footnotes.
footnotes_output_footer()
Displays the 'LOVE FOOTNOTES' slug if enabled.
public
footnotes_output_footer() : mixed
Tags
Return values
mixed —footnotes_output_head()
Outputs the custom css to the header of the public page.
public
footnotes_output_head() : mixed
Tags
Return values
mixed —generate_excerpt()
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
Return values
string —$p_str_content An excerpt of the post. Applies full WordPress excerpt processing.
generate_excerpt_with_footnotes()
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
Return values
string —$p_str_content An excerpt of the post. Does not apply full WordPress excerpt processing.
reference_container()
Generates the reference container.
public
reference_container() : string
Tags
Return values
string —register_hooks()
Register WordPress hooks to replace Footnotes in the content of a public page.
public
register_hooks() : mixed
Tags
Return values
mixed —search()
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
Return values
string —unify_delimiters()
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.